Systems and methods for managing loading priority or sequencing of fragments of a web object

ABSTRACT

This disclosure is directed to methods and systems for delivering an item of web content requested by a client. An intermediary between a client and a server may intercept a request from the client to the server for an item of web content. The intermediary may split the item of web content into a plurality of fragments. The intermediary may identify, responsive to the request, a first fragment of the plurality of fragments to transmit to the client. The intermediary may inject executable code into the first fragment of the plurality of fragments. The executable code may be configured to conditionally incorporate additional fragments from the plurality of fragments into the first fragment at the client.

RELATED APPLICATIONS

This application is a nonprovisional of, and claims priority to U.S.provisional application 61/880,347, filed Sep. 20, 2013, entitled“SYSTEMS AND METHODS FOR MANAGING LOADING PRIORITY OR SEQUENCING OFFRAGMENTS OF A WEB OBJECT”, which is hereby incorporated by reference inits entirety for all purposes.

FIELD OF THE DISCLOSURE

This disclosure generally relates to systems and methods for webperformance optimization and dynamic content delivery. In particular,this disclosure relates to systems and methods for dynamically managingloading priority or sequencing of fragments of a web object.

BACKGROUND OF THE DISCLOSURE

Content delivery systems are typically used to improve the end-to-endperformance of web content delivery between a server and a client. Thesesystems may cache static web pages or other objects, and may serve thesecached objects to requesting clients directly, thereby improvingperformance while reducing load and congestion on a content originatorsuch as a server. However, a significant portion of typical web contentmay be dynamic in nature. Thus, web pages that are returned to differentclients at different times may differ significantly. For example, webpages catering to personalized web applications are commonly dynamic. Assuch, typical content delivery systems may not handle dynamic contentefficiently. For a web application involving significant dynamiccontent, when a web client (“browser”) requests a webpage, the webpageis served by a web server. The web server may perform certain businesslogic and database query processing in order to generate the webpagefrom both dynamic and static content. This server-side processing cantake seconds or even longer, while the web client may be waiting for theserver to respond. This can significantly impair the web experience of auser. Moreover, the number of web objects referenced in the web page,both static and dynamic, may affect web page loading and userexperience.

BRIEF SUMMARY OF THE DISCLOSURE

Described herein are systems and methods for dynamically modifying arequested web page from a server at an intermediary for presentation ata client. The present systems and methods can provide real timeintervention via a cloud service or at an intermediary, upon receiving aclient's request for a web page of a server. The intermediary may managecontent and/or resources delivered to the client while communicatingwith the server to process or fulfill the request. The intermediary mayidentify or define a plurality of HTML fragments that can be assembledinto a modified web page for the client, in response to the request. Theintermediary may provide a plurality of web object fragments that can beassembled into a web object of a web page. Web objects can include anHTML page, a script (e.g., Javascript) file, an image, a video object,audio object, a flash file or small web format (SWF) file, or a CSSfile, as examples. The fragments may be delivered by the intermediary,sequentially and in a controlled manner over a number of transmissions(e.g., as data is available at the intermediary and/or from the server,or as needed to improve page loading performance and/or userexperience), for processing by the client's browser and presented to theuser. Code incorporated into the web page may affect a loading priorityor sequence of certain web object fragments on the browser. Instead ofrendering all fragments, only certain fragments are delivered and/orrendered as needed, leading to bandwidth and processing efficiencies.One or a combination of such mechanisms can lead to improved or enhancedsystem performance and/or user experience.

The intermediary may be configured to inject or incorporate code into atransmitted fragment. The code may be executed by the browser (e.g., inthe background) as one or more fragments are loaded or rendered as partof the modified web page. In some embodiments, the code may beintelligently configured to perform certain actions that modify the webpage or affect some aspect of a resource of the web page. The web pagemay be modified to improve user experience. For example, the code may,upon execution, pre-fetch a resource for faster loading at a rightmoment, provide cookie management for enhanced web-based interactions,incorporate third-party resources to a web page, or alter thecharacteristics of resources. In certain embodiments, the code injectedand delivered via a first fragment may control how subsequent fragmentsare incorporated or assembled with the first fragment. For example, thecode may identify unique identifiers or markers in the first fragmentfor additional fragments, and may selectively generate HTML requests toretrieve particular fragments. In some embodiments, the code may controlor manage loading and/or integration of web object fragments at theclient, for example, by changing a rendering priority or characteristicof one or more fragments. A requested web page may therefore be modifieddynamically at the intermediary and assembled at the client withoutaffecting how the server generates its web pages. Code injected into theweb page fragments can execute in the background as each fragment isloaded onto a browser, altering web page features without the user evenrealizing except for an improved user experience, e.g., a moreresponsive loading or rendering of web page elements, a richerexperience with additional or custom content, or an improved or moreappropriate web page layout.

In one aspect, the present disclosure is directed to a method fordelivering an item of web content requested by a client. The method mayinclude intercepting, by an intermediary between a client and a server,a request from the client to the server for an item of web content. Theintermediary may split the item of web content into a plurality offragments. The intermediary may identify, responsive to the request, afirst fragment of the plurality of fragments to transmit to the client.The intermediary may inject executable code into the first fragment ofthe plurality of fragments. The executable code may be configured toconditionally incorporate additional fragments from the plurality offragments into the first fragment at the client.

In some embodiments, the intermediary may determine that the item of webcontent comprises one of: an HTML page, an image, a cascading stylesheet (CSS), a script file, a video object, an audio object, and a Flashfile or small web format (SWF) file. The intermediary may split the itemof web content into the plurality of fragments based on a version of theitem of web content cached by the intermediary. The intermediary maysplit the item of web content into a plurality of fragments based on aresponse from the server to the request. The intermediary may perform atleast one of the splitting and the identifying, based on a user-definedconfiguration of the item of web content. The intermediary may interceptthe request for the item of web content, and the item of web content mayinclude dynamic or personalized information to be generated by theserver. The intermediary may send the request to the server. Theintermediary may deliver the first fragment from a cache by theintermediary.

In certain embodiments, the intermediary may update a cache based on aresponse from the server to the request. The intermediary may form asecond fragment of the plurality of fragments based on a response fromthe server to the request. The intermediary may deliver one or more ofthe additional fragments to the client based on at least one of: anetwork condition, dependencies between related fragments, size of afragment, importance of a fragment, availability of a fragment, andvisibility of a fragment. The intermediary may determine to deliver oneof the additional fragments to the client responsive to at least one of:a user event, a timer event and a document object model event, thatinvolves a display or use of the corresponding fragment at the client.The intermediary may inject the executable code, the executable code mayinclude code expressed in at least one of: ECMAScript language or alanguage similar or related to the ECMAScript language, ActionScriptlanguage, visual basic language and hypertext markup language.

In another aspect, the present disclosure is directed to a system fordelivering an item of web content requested by a client. The system mayinclude an intermediary between a client and a server. The intermediarymay intercept a request from the client to the server for an item of webcontent. The intermediary may split the item of web content into aplurality of fragments. The intermediary may identify a first fragmentof the plurality of fragments to transmit to the client responsive tothe request. The system may include executable code, injected by theintermediary into the first fragment of the plurality of fragments forexecution at the client. The code may be configured to conditionallyincorporate additional fragments from the plurality of fragments intothe first fragment at the client.

In some embodiments, the intermediary determines that the item of webcontent comprises one of: an HTML page, an image, a cascading stylesheet (CSS), a script, a video object, an audio object, and a Flash fileor small web format (SWF) file. The intermediary may split the item ofweb content into the plurality of fragments based on a version of theitem of web content cached by the intermediary. The intermediary maysplit the item of web content into a plurality of fragments based on aresponse from the server to the request. The intermediary may perform atleast one of the splitting and the identifying based on a user-definedconfiguration of the item of web content. The intermediary may interceptthe request for the item of web content, and the item of web content mayinclude dynamic or personalized information to be generated by theserver. The intermediary may send the request to the server. Theintermediary may deliver the first fragment from a cache by theintermediary.

In some embodiments, the intermediary updates a cache based on aresponse from the server to the request. The intermediary may form asecond fragment of the plurality of fragments based on a response fromthe server to the request. The intermediary may determine to deliver oneor more of the additional fragments to the client based on at least oneof: a network condition, dependencies between related fragments, size ofa fragment, importance of a fragment, availability of a fragment, andvisibility of a fragment. The intermediary may determine to deliver oneof the additional fragments to the client responsive to at least one of:a user event, a timer event and a document object model event, thatinvolves a display or use of the corresponding fragment at the client.The intermediary may inject the executable code, and the executable codemay include code expressed in at least one of: ECMAScript language or alanguage similar or related to the ECMAScript language, ActionScriptlanguage, visual basic language and hypertext markup language.

In yet another aspect, the present disclosure is directed to a methodfor managing rendering of a web page in a browser. The method mayinclude executing, by a client operated by a user, code within a firstfragment of a web page as the first fragment is presented to the user.The code may be injected into the first fragment by an intermediarybetween the client and a server of the web page. The intermediary mayhave split the web page into the first fragment and a plurality offragments. The intermediary may have modified a default renderingcharacteristic derived from the server for each of the plurality offragments. Each of the modified rendering characteristic may include atrigger and an action for rendering of a corresponding fragment of theplurality of fragments. The executing code may dynamically detect atrigger for rendering of a second fragment from the plurality offragments. The trigger may include one of: a user event, a timer eventand a document object model event, that involves a display or use of thesecond fragment. The executing code may initiate, responsive to thedetected trigger, a corresponding action for rendering of the secondfragment within the first fragment.

In some embodiments, the client may send a request to the server for theweb page, and the request may be intercepted by the intermediary. Theclient may receive, from the intermediary, the first fragment with theinjected code. The client may execute the code. The code may include atleast one of: code expressed in JavaScript language, code expressed inECMAScript language or a language similar or related to the ECMAScriptlanguage, language code expressed in ActionScript language, codeexpressed in hypertext markup language, code expressed in visual basiclanguage, a plug-in, code referencing a browser plug-in, and codereferencing a native module. The client may receive at least one of theplurality of fragments from the intermediary, each of the plurality offragments having a rendering characteristic modified by the intermediarybased on a configuration. The client may perform a pre-trigger actionfor the second fragment prior to detecting the trigger. The pre-triggeraction may include at least one of: withholding rendering of the secondfragment, displaying nothing at an identified location of the web page,and displaying at least one item, the at least one item comprising atleast one of: an indicator or message indicating that an item isloading, a temporary or placeholder item or image, an advertisement, anda special call-to-action item.

In some embodiments, the client may detect a user event comprising oneof: a click event, a tap event, a touch event, a mouse-over event and ascroll event on the web page. The client may detect that a viewingregion of the client corresponds to a portion of the web page involvinga display or use of the second fragment of the web page. The client maydetect that a viewing region of the client corresponds to a portion ofthe first fragment that includes a unique identifier for the secondfragment. The code or client may initiate the corresponding action, thecorresponding action comprising replacing one or more displayed itemswith the rendering of the second fragment. The code or client mayinitiate the corresponding action, the corresponding action may includerendering the second fragment immediately or as soon as the secondfragment is available for rendering. The code or client may initiate thecorresponding action, the corresponding action may include rendering thesecond fragment based on a specified delay or after a subset of theplurality of fragments have been loaded. The code or client may initiatethe corresponding action, the corresponding action may include sending arequest to the server for downloading a resource, the second fragment ora related fragment. The code or client may initiate the correspondingaction, the corresponding action may include sending a request to theserver, the request intercepted or received by the intermediary. Thecode or client may initiate the corresponding action for rendering thesecond fragment, the second fragment may include one of at least aportion of: an image, a cascading style sheet (CSS), a script, a videoobject, an audio object, a flash file or small web format (SWF) file,and a HTML file.

In still another aspect, the present disclosure is directed to a systemfor managing rendering of a web page in a browser. The system mayinclude a browser executing on a client operated by a user. Code may beinjected into a first fragment of a web page by an intermediary betweenthe client and a server of the web page. The code may be executed by thebrowser as the first fragment is presented to the user. The intermediarymay have split the web page into the first fragment and a plurality offragments. The intermediary may have modified a default renderingcharacteristic derived from the server for each of the plurality offragments. Each of the modified rendering characteristic may include atrigger and an action for rendering of a corresponding fragment of theplurality of fragments. The executing code may dynamically detect atrigger for rendering of a second fragment from the plurality offragments. The trigger may include one of: a user event, a timer eventand a document object model event, that involves a display or use of thesecond fragment. The executing code may initiate, responsive to thedetected trigger, a corresponding action for rendering of the secondfragment within the first fragment.

In some embodiments, the browser sends a request to the server for theweb page, the request intercepted by the intermediary. The browser mayreceive from the intermediary the first fragment with the injected code.The code may include at least one of: code expressed in ECMAScriptlanguage or a language similar or related to the ECMAScript language,code expressed in JavaScript language, code expressed in ActionScriptlanguage, code expressed in hypertext markup language, code expressed invisual basic language, a plug-in, code referencing a browser plug-in,and code referencing a native module. The browser may receive at leastone of the plurality of fragments from the intermediary. Each of theplurality of fragments may have a rendering characteristic modified bythe intermediary based on a configuration. The browser may perform apre-trigger action for the corresponding fragment prior to detecting thetrigger, the pre-trigger action may include at least one of: withholdingrendering of the second fragment, displaying nothing at an identifiedlocation of the web page, and displaying at least one item, the at leastone item comprising at least one of: an indicator or message indicatingthat an item is loading, a temporary or placeholder item or image, anadvertisement, and a special call-to-action item. The executing code maydetect a user event including one of: a click event, a tap event, atouch event, a mouse-over event and a scroll event on the web page. Theexecuting code may detect that a viewing region of the clientcorresponds to a portion of the web page involving a display or use ofthe second fragment of the web page. The executing code may detect thata viewing region of the client corresponds to a portion of the firstfragment that includes a unique identifier for the second fragment.

In some embodiments, the executing code initiates the correspondingaction, the corresponding action comprising replacing one or moredisplayed items with the rendering of the second fragment. The executingcode may initiate the corresponding action, the corresponding actioncomprising rendering the second fragment immediately or as soon as thesecond fragment is available for rendering. The executing code mayinitiate the corresponding action, the corresponding action may includerendering the second fragment based on a specified delay or after asubset of the plurality of fragments have been loaded. The executingcode may initiate the corresponding action, the corresponding action mayinclude sending a request to the server for downloading a resource, thesecond fragment or a related fragment. The executing code may initiatethe corresponding action, the corresponding action may include sending arequest to the server, the request intercepted or received by theintermediary. The executing code may initiate the corresponding actionfor rendering the second fragment, the second fragment may include oneof at least a portion of: an image, a cascading style sheet (CSS), ascript, a video object, an audio object, a flash file or small webformat (SWF) file, and a HTML file.

In another aspect, the present disclosure is directed to a method formanaging delivery and rendering of an item of web content. The methodmay include intercepting, by an intermediary between a client and aserver, a request from the client to the server for an item of webcontent. The intermediary may split the item of web content into a firstfragment and a plurality of fragments. The intermediary may inject, intothe first fragment for delivery to the client, executable code and aplurality of unique identifiers corresponding to the plurality offragments. The intermediary may send the first fragment to the client.The injected executable code may generate a request at the client to theserver for a second fragment from the plurality of fragments responsiveto detecting an event. The detected event may correspond to a uniqueidentifier of the second fragment, and may include one of: a user event,a timer event and a document object model event, that involves a displayor use of the second fragment. The intermediary may intercept therequest for the second fragment. The intermediary may send the secondfragment to the client responsive to the request for the secondfragment.

In some embodiments, the intermediary may determine that the item of webcontent comprises one of: an HTML page, an image, a cascading stylesheet (CSS), a script file, a video object, an audio object, and a Flashfile or small web format (SWF) file. The intermediary may split the itemof web content based on a version of the item of web content cached bythe intermediary. The intermediary may split the item of web contentbased on a response from the server to the request for the item of webcontent. The intermediary may split the item of web content based on aconfiguration of the item of web content. The intermediary may modify adefault rendering characteristic derived from the server for each of theplurality of fragments. Each of the modified rendering characteristicmay include an action and a trigger based on detecting one of: a userevent, a timer event and a document object model event, that involves adisplay or use of a corresponding fragment. The intermediary may formthe first fragment based on a version of the first fragment cached bythe intermediary. The intermediary may send to the server theintercepted request for the item of web content. The intermediary mayupdate a cache based on a response from the server to the request forthe item of web content.

In some embodiments, the intermediary may store the first fragment in acache. The intermediary may inject the executable code into the firstfragment, the executable code comprising code expressed in at least oneof: ECMAScript language or a language similar or related to theECMAScript language, JavaScript language, ActionScript language, visualbasic language and hypertext markup language. The intermediary mayintercept the request for the second fragment. The intercepted requestfor the second fragment may be prevented from reaching the server by theintermediary. The intermediary may form the second fragment based on aversion of the second fragment cached by the intermediary. Theintermediary may form the second fragment based on a response from theserver to the request for the item of web content. The intermediary maywait for a response from the server to the request for the item of webcontent, to generate the second fragment.

In another aspect, the present disclosure is directed to a system formanaging delivery and rendering of an item of web content. The systemmay include or incorporate executable code injected into a firstfragment of an item of web content, for delivery to a client. Theinjected executable code may generate a request at the client to aserver for a second fragment from a plurality of fragments of the itemof web content responsive to detecting an event. The detected event maycorrespond to a unique identifier of the second fragment, and mayinclude one of: a user event, a timer event and a document object modelevent, that involves a display or use of the second fragment. The systemmay include an intermediary between the client and the server. Theintermediary may intercept a request from the client to the server forthe item of web content. The intermediary may split the item of webcontent into the first fragment and the plurality of fragments. Theintermediary may inject into the first fragment the executable code anda plurality of unique identifiers corresponding to the plurality offragments. The intermediary may send the first fragment to the client.The intermediary may intercept the request for the second fragment. Theintermediary may send the second fragment to the client responsive tothe request for the second fragment.

In some embodiments, the intermediary determines that the item of webcontent includes one of: an HTML page, an image, a cascading style sheet(CSS), a script file, a video object, an audio object, and a Flash fileor small web format (SWF) file. The intermediary may split the item ofweb content based on a version of the item of web content cached by theintermediary. The intermediary may split the item of web content basedon a response from the server to the request for the item of webcontent. The intermediary may split the item of web content based on aconfiguration of the item of web content. The intermediary may modify adefault rendering characteristic derived from the server for each of theplurality of fragments. Each of the modified rendering characteristicmay include an action and a trigger based on detecting one of: a userevent, a timer event and a document object model event, that involves adisplay or use of a corresponding fragment. The intermediary may formthe first fragment based on a version of the first fragment cached bythe intermediary. The intermediary may send to the server theintercepted request for the item of web content. The intermediary mayupdate a cache based on a response from the server to the request forthe item of web content.

In certain embodiments, the intermediary stores the first fragment in acache. The intermediary may inject the executable code into the firstfragment. The executable code may include code expressed in at least oneof: ECMAScript language or a language similar or related to theECMAScript language (e.g., JavaScript), ActionScript language, visualbasic language and hypertext markup language. The intermediary mayintercept the request for the second fragment. The intercepted requestfor the second fragment may be prevented from reaching the server. Theintermediary may form the second fragment based on a version of thesecond fragment cached by the intermediary. The intermediary may formthe second fragment based on a response from the server to the requestfor the item of web content. The intermediary may wait for a responsefrom the server to the request for the item of web content, to generatethe second fragment.

The details of various embodiments of the invention are set forth in theaccompanying drawings and the description below.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other objects, aspects, features, and advantages ofthe disclosure will become more apparent and better understood byreferring to the following description taken in conjunction with theaccompanying drawings, in which:

FIG. 1A is a block diagram depicting an embodiment of a networkenvironment comprising client machines in communication with remotemachines;

FIGS. 1B and 1C are block diagrams depicting embodiments of computingdevices useful in connection with the methods and systems describedherein;

FIG. 2A is a block diagram depicting one embodiment of a system fordynamically modifying a requested web page from a server forpresentation at a client;

FIGS. 2B and 2C are flow diagrams depicting embodiments of process stepsin a method for dynamically modifying a requested web page from a serverfor presentation at a client;

FIG. 2D comprises flow diagrams of embodiments of methods for handling awidget in a browser with and without a web performance optimization(WPO) system;

FIG. 2E includes one embodiment of a web page segment including ahighlighted portion referencing an image or a resource;

FIGS. 2F-2H comprise embodiments of a user interface for configuringtag-based and other types of modifications to a requested web page;

FIG. 2I is a flow diagram of an embodiment of a method for dynamicallymodifying a requested web page from a server for presentation at aclient;

FIG. 2J is a block diagram of an embodiment of a system for dynamicallymanaging loading priority or sequencing of fragments of a web object;

FIG. 2K depicts one embodiment of a HTML document that can be processedby systems and methods for dynamically managing loading priority orsequencing of fragments of a web object;

FIG. 2L depicts one embodiment of a method for performing a type ofapplication sequencing;

FIG. 2M depicts another embodiment of a method for performing a type ofapplication sequencing;

FIG. 2N depicts one embodiment of a system for managing delivery of webcontent;

FIG. 2O depicts one embodiment of a comparison between Javascriptoptimization results between a number of applications;

FIG. 2P depicts one embodiment of a method for application sequencing;

FIG. 2Q depicts one embodiment of a method for delivering an item of webcontent requested by a client; and

FIG. 2R depicts one embodiment of a method for managing rendering of aweb page in a browser.

The features and advantages of the present invention will become moreapparent from the detailed description set forth below when taken inconjunction with the drawings, in which like reference charactersidentify corresponding elements throughout. In the drawings, likereference numbers generally indicate identical, functionally similar,and/or structurally similar elements.

DETAILED DESCRIPTION

For purposes of reading the description of the various embodimentsbelow, the following descriptions of the sections of the specificationand their respective contents may be helpful:

-   -   Section A describes a network environment and computing        environment which may be useful for practicing embodiments        described herein;    -   Section B describes embodiments of systems and methods for        dynamically modifying a requested web page from a server for        presentation at a client; and    -   Section C describes embodiments of systems and methods for        dynamically managing loading priority or sequencing of fragments        of a web object.        A. Computing and Network Environment

Prior to discussing specific embodiments of the present solution, it maybe helpful to describe aspects of the operating environment as well asassociated system components (e.g., hardware elements) in connectionwith the methods and systems described herein. Referring to FIG. 1A, anembodiment of a network environment is depicted. In brief overview, thenetwork environment includes one or more clients 101 a-101 n (alsogenerally referred to as local machine(s) 101, client(s) 101, clientnode(s) 101, client machine(s) 101, client computer(s) 101, clientdevice(s) 101, endpoint(s) 101, or endpoint node(s) 101) incommunication with one or more servers 106 a-106 n (also generallyreferred to as server(s) 106, node 106, or remote machine(s) 106) viaone or more networks 104. In some embodiments, a client 101 has thecapacity to function as both a client node seeking access to resourcesprovided by a server and as a server providing access to hostedresources for other clients 101 a-101 n.

Although FIG. 1A shows a network 104 between the clients 101 and theservers 106, the clients 101 and the servers 106 may be on the samenetwork 104. The network 104 can be a local-area network (LAN), such asa company Intranet, a metropolitan area network (MAN), or a wide areanetwork (WAN), such as the Internet or the World Wide Web. In someembodiments, there are multiple networks 104 between the clients 101 andthe servers 106. In one of these embodiments, a network 104′ (not shown)may be a private network and a network 104 may be a public network. Inanother of these embodiments, a network 104 may be a private network anda network 104′ a public network. In still another of these embodiments,networks 104 and 104′ may both be private networks.

The network 104 may be any type and/or form of network and may includeany of the following: a point-to-point network, a broadcast network, awide area network, a local area network, a telecommunications network, adata communication network, a computer network, an ATM (AsynchronousTransfer Mode) network, a SONET (Synchronous Optical Network) network, aSDH (Synchronous Digital Hierarchy) network, a wireless network and awireline network. In some embodiments, the network 104 may comprise awireless link, such as an infrared channel or satellite band. Thetopology of the network 104 may be a bus, star, or ring networktopology. The network 104 may be of any such network topology as knownto those ordinarily skilled in the art capable of supporting theoperations described herein. The network may comprise mobile telephonenetworks utilizing any protocol(s) or standard(s) used to communicateamong mobile devices, including AMPS, TDMA, CDMA, GSM, GPRS, UMTS,WiMAX, 3G or 4G. In some embodiments, different types of data may betransmitted via different protocols. In other embodiments, the sametypes of data may be transmitted via different protocols.

In some embodiments, the system may include multiple, logically-groupedservers 106. In one of these embodiments, the logical group of serversmay be referred to as a server farm 38 or a machine farm 38. In anotherof these embodiments, the servers 106 may be geographically dispersed.In other embodiments, a machine farm 38 may be administered as a singleentity. In still other embodiments, the machine farm 38 includes aplurality of machine farms 38. The servers 106 within each machine farm38 can be heterogeneous—one or more of the servers 106 or machines 106can operate according to one type of operating system platform (e.g.,WINDOWS, manufactured by Microsoft Corp. of Redmond, Wash.), while oneor more of the other servers 106 can operate on according to anothertype of operating system platform (e.g., Unix or Linux).

In one embodiment, servers 106 in the machine farm 38 may be stored inhigh-density rack systems, along with associated storage systems, andlocated in an enterprise data center. In this embodiment, consolidatingthe servers 106 in this way may improve system manageability, datasecurity, the physical security of the system, and system performance bylocating servers 106 and high performance storage systems on localizedhigh performance networks. Centralizing the servers 106 and storagesystems and coupling them with advanced system management tools allowsmore efficient use of server resources.

The servers 106 of each machine farm 38 do not need to be physicallyproximate to another server 106 in the same machine farm 38. Thus, thegroup of servers 106 logically grouped as a machine farm 38 may beinterconnected using a wide-area network (WAN) connection or ametropolitan-area network (MAN) connection. For example, a machine farm38 may include servers 106 physically located in different continents ordifferent regions of a continent, country, state, city, campus, or room.Data transmission speeds between servers 106 in the machine farm 38 canbe increased if the servers 106 are connected using a local-area network(LAN) connection or some form of direct connection. Additionally, aheterogeneous machine farm 38 may include one or more servers 106operating according to a type of operating system, while one or moreother servers 106 execute one or more types of hypervisors rather thanoperating systems. In these embodiments, hypervisors may be used toemulate virtual hardware, partition physical hardware, virtualizephysical hardware, and execute virtual machines that provide access tocomputing environments. Hypervisors may include those manufactured byVMWare, Inc., of Palo Alto, Calif.; the Xen hypervisor, an open sourceproduct whose development is overseen by Citrix Systems, Inc.; theVirtualServer or virtual PC hypervisors provided by Microsoft or others.

In order to manage a machine farm 38, at least one aspect of theperformance of servers 106 in the machine farm 38 should be monitored.Typically, the load placed on each server 106 or the status of sessionsrunning on each server 106 is monitored. In some embodiments, acentralized service may provide management for machine farm 38. Thecentralized service may gather and store information about a pluralityof servers 106, respond to requests for access to resources hosted byservers 106, and enable the establishment of connections between clientmachines 101 and servers 106.

Management of the machine farm 38 may be de-centralized. For example,one or more servers 106 may comprise components, subsystems and modulesto support one or more management services for the machine farm 38. Inone of these embodiments, one or more servers 106 provide functionalityfor management of dynamic data, including techniques for handlingfailover, data replication, and increasing the robustness of the machinefarm 38. Each server 106 may communicate with a persistent store and, insome embodiments, with a dynamic store.

Server 106 may be a file server, application server, web server, proxyserver, appliance, network appliance, gateway, gateway, gateway server,virtualization server, deployment server, SSL VPN server, or firewall.In one embodiment, the server 106 may be referred to as a remote machineor a node. In another embodiment, a plurality of nodes 290 may be in thepath between any two communicating servers.

In one embodiment, the server 106 provides the functionality of a webserver. In another embodiment, the server 106 a receives requests fromthe client 101, forwards the requests to a second server 206 b andresponds to the request by the client 101 with a response to the requestfrom the server 106 b. In still another embodiment, the server 106acquires an enumeration of applications available to the client 101 andaddress information associated with a server 106′ hosting an applicationidentified by the enumeration of applications. In yet anotherembodiment, the server 106 presents the response to the request to theclient 101 using a web interface. In one embodiment, the client 101communicates directly with the server 106 to access the identifiedapplication. In another embodiment, the client 101 receives output data,such as display data, generated by an execution of the identifiedapplication on the server 106.

The client 101 and server 106 may be deployed as and/or executed on anytype and form of computing device, such as a computer, network device orappliance capable of communicating on any type and form of network andperforming the operations described herein. FIGS. 1B and 1C depict blockdiagrams of a computing device 100 useful for practicing an embodimentof the client 101 or a server 106. As shown in FIGS. 1B and 1C, eachcomputing device 100 includes a central processing unit 121, and a mainmemory unit 122. As shown in FIG. 1B, a computing device 100 may includea storage device 128, an installation device 116, a network interface118, an I/O controller 123, display devices 124 a-101 n, a keyboard 126and a pointing device 127, such as a mouse. The storage device 128 mayinclude, without limitation, an operating system and/or software. Asshown in FIG. 1C, each computing device 100 may also include additionaloptional elements, such as a memory port 103, a bridge 170, one or moreinput/output devices 130 a-130 n (generally referred to using referencenumeral 130), and a cache memory 140 in communication with the centralprocessing unit 121.

The central processing unit 121 is any logic circuitry that responds toand processes instructions fetched from the main memory unit 122. Inmany embodiments, the central processing unit 121 is provided by amicroprocessor unit, such as: those manufactured by Intel Corporation ofMountain View, Calif.; those manufactured by Motorola Corporation ofSchaumburg, Ill.; those manufactured by International Business Machinesof White Plains, N.Y.; or those manufactured by Advanced Micro Devicesof Sunnyvale, Calif. The computing device 100 may be based on any ofthese processors, or any other processor capable of operating asdescribed herein.

Main memory unit 122 may be one or more memory chips capable of storingdata and allowing any storage location to be directly accessed by themicroprocessor 121, such as Static random access memory (SRAM), BurstSRAM or SynchBurst SRAM (BSRAM), Dynamic random access memory (DRAM),Fast Page Mode DRAM (FPM DRAM), Enhanced DRAM (EDRAM), Extended DataOutput RAM (EDO RAM), Extended Data Output DRAM (EDO DRAM), BurstExtended Data Output DRAM (BEDO DRAM), Enhanced DRAM (EDRAM),synchronous DRAM (SDRAM), JEDEC SRAM, PC100 SDRAM, Double Data RateSDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), SyncLink DRAM (SLDRAM),Direct Rambus DRAM (DRDRAM), Ferroelectric RAM (FRAM), NAND Flash, NORFlash and Solid State Drives (SSD). The main memory 122 may be based onany of the above described memory chips, or any other available memorychips capable of operating as described herein. In the embodiment shownin FIG. 1B, the processor 121 communicates with main memory 122 via asystem bus 150 (described in more detail below). FIG. 1C depicts anembodiment of a computing device 100 in which the processor communicatesdirectly with main memory 122 via a memory port 103. For example, inFIG. 1C the main memory 122 may be DRDRAM.

FIG. 1C depicts an embodiment in which the main processor 121communicates directly with cache memory 140 via a secondary bus,sometimes referred to as a backside bus. In other embodiments, the mainprocessor 121 communicates with cache memory 140 using the system bus150. Cache memory 140 typically has a faster response time than mainmemory 122 and is typically provided by SRAM, BSRAM, or EDRAM. In theembodiment shown in FIG. 1C, the processor 121 communicates with variousI/O devices 130 via a local system bus 150. Various buses may be used toconnect the central processing unit 121 to any of the I/O devices 130,including a VESA VL bus, an ISA bus, an EISA bus, a MicroChannelArchitecture (MCA) bus, a PCI bus, a PCI-X bus, a PCI-Express bus, or aNuBus. For embodiments in which the I/O device is a video display 124,the processor 121 may use an Advanced Graphics Port (AGP) to communicatewith the display 124. FIG. 1C depicts an embodiment of a computer 100 inwhich the main processor 121 may communicate directly with I/O device130 b, for example via HYPERTRANSPORT, RAPIDIO, or INFINIBANDcommunications technology. FIG. 1C also depicts an embodiment in whichlocal busses and direct communication are mixed: the processor 121communicates with I/O device 130 a using a local interconnect bus whilecommunicating with I/O device 130 b directly.

A wide variety of I/O devices 130 a-130 n may be present in thecomputing device 100. Input devices include keyboards, mice, trackpads,trackballs, microphones, dials, touch pads, and drawing tablets. Outputdevices include video displays, speakers, inkjet printers, laserprinters, projectors and dye-sublimation printers. The I/O devices maybe controlled by an I/O controller 123 as shown in FIG. 1B. The I/Ocontroller may control one or more I/O devices such as a keyboard 126and a pointing device 127, e.g., a mouse or optical pen. Furthermore, anI/O device may also provide storage and/or an installation medium 116for the computing device 100. In still other embodiments, the computingdevice 100 may provide USB connections (not shown) to receive handheldUSB storage devices such as the USB Flash Drive line of devicesmanufactured by Twintech Industry, Inc. of Los Alamitos, Calif.

Referring again to FIG. 1B, the computing device 100 may support anysuitable installation device 116, such as a disk drive, a CD-ROM drive,a CD-R/RW drive, a DVD-ROM drive, a flash memory drive, tape drives ofvarious formats, USB device, hard-drive or any other device suitable forinstalling software and programs. The computing device 100 may furthercomprise a storage device, such as one or more hard disk drives orredundant arrays of independent disks, for storing an operating systemand other related software, and for storing application softwareprograms such as any program related to the software 120 for the demandside platform. Optionally, any of the installation devices 116 couldalso be used as the storage device. Additionally, the operating systemand the software can be run from a bootable medium, for example, abootable CD.

Furthermore, the computing device 100 may include a network interface118 to interface to the network 104 through a variety of connectionsincluding, but not limited to, standard telephone lines, LAN or WANlinks (e.g., 802.11, T1, T3, 56 kb, X.25, SNA, DECNET), broadbandconnections (e.g., ISDN, Frame Relay, ATM, Gigabit Ethernet,Ethernet-over-SONET), wireless connections, or some combination of anyor all of the above. Connections can be established using a variety ofcommunication protocols (e.g., TCP/IP, IPX, SPX, NetBIOS, Ethernet,ARCNET, SONET, SDH, Fiber Distributed Data Interface (FDDI), RS232, IEEE802.11, IEEE 802.11a, IEEE 802.11b, IEEE 802.11g, IEEE 802.11n, CDMA,GSM, WiMax and direct asynchronous connections). In one embodiment, thecomputing device 100 communicates with other computing devices 100′ viaany type and/or form of gateway or tunneling protocol such as SecureSocket Layer (SSL) or Transport Layer Security (TLS), or the CitrixGateway Protocol manufactured by Citrix Systems, Inc. of Ft. Lauderdale,Fla. The network interface 118 may comprise a built-in network adapter,network interface card, PCMCIA network card, card bus network adapter,wireless network adapter, USB network adapter, modem or any other devicesuitable for interfacing the computing device 100 to any type of networkcapable of communication and performing the operations described herein.

In some embodiments, the computing device 100 may comprise or beconnected to multiple display devices 124 a-124 n, which each may be ofthe same or different type and/or form. As such, any of the I/O devices130 a-130 n and/or the I/O controller 123 may comprise any type and/orform of suitable hardware, software, or combination of hardware andsoftware to support, enable or provide for the connection and use ofmultiple display devices 124 a-124 n by the computing device 100. Forexample, the computing device 100 may include any type and/or form ofvideo adapter, video card, driver, and/or library to interface,communicate, connect or otherwise use the display devices 124 a-124 n.In one embodiment, a video adapter may comprise multiple connectors tointerface to multiple display devices 124 a-124 n. In other embodiments,the computing device 100 may include multiple video adapters, with eachvideo adapter connected to one or more of the display devices 124 a-124n. In some embodiments, any portion of the operating system of thecomputing device 100 may be configured for using multiple displays 124a-124 n. In other embodiments, one or more of the display devices 124a-124 n may be provided by one or more other computing devices, such ascomputing devices 100 a and 100 b connected to the computing device 100,for example, via a network. These embodiments may include any type ofsoftware designed and constructed to use another computer's displaydevice as a second display device 124 a for the computing device 100.One ordinarily skilled in the art will recognize and appreciate thevarious ways and embodiments that a computing device 100 may beconfigured to have multiple display devices 124 a-124 n.

In further embodiments, an I/O device 130 may be a bridge between thesystem bus 150 and an external communication bus, such as a USB bus, anApple Desktop Bus, an RS-232 serial connection, a SCSI bus, a FireWirebus, a FireWire 800 bus, an Ethernet bus, an AppleTalk bus, a GigabitEthernet bus, an Asynchronous Transfer Mode bus, a FibreChannel bus, aSerial Attached small computer system interface bus, or a HDMI bus.

A computing device 100 of the sort depicted in FIGS. 1B and 1C typicallyoperates under the control of operating systems, which controlscheduling of tasks and access to system resources. The computing device100 can be running any operating system such as any of the versions ofthe MICROSOFT WINDOWS operating systems, the different releases of theUnix and Linux operating systems, any version of the MAC OS forMacintosh computers, any embedded operating system, any real-timeoperating system, any open source operating system, any proprietaryoperating system, any operating systems for mobile computing devices, orany other operating system capable of running on the computing deviceand performing the operations described herein. Typical operatingsystems include, but are not limited to: Android, manufactured by GoogleInc; WINDOWS 7 and 8, manufactured by Microsoft Corporation of Redmond,Wash.; MAC OS, manufactured by Apple Computer of Cupertino, Calif.;WebOS, manufactured by Research In Motion (RIM); OS/2, manufactured byInternational Business Machines of Armonk, N.Y.; and Linux, afreely-available operating system distributed by Caldera Corp. of SaltLake City, Utah, or any type and/or form of a Unix operating system,among others.

The computer system 100 can be any workstation, telephone, desktopcomputer, laptop or notebook computer, server, handheld computer, mobiletelephone or other portable telecommunications device, media playingdevice, a gaming system, mobile computing device, or any other typeand/or form of computing, telecommunications or media device that iscapable of communication. The computer system 100 has sufficientprocessor power and memory capacity to perform the operations describedherein. For example, the computer system 100 may comprise a device ofthe IPAD or IPOD family of devices manufactured by Apple Computer ofCupertino, Calif., a device of the PLAYSTATION family of devicesmanufactured by the Sony Corporation of Tokyo, Japan, a device of theNINTENDO/Wii family of devices manufactured by Nintendo Co., Ltd., ofKyoto, Japan, or an XBOX device manufactured by the MicrosoftCorporation of Redmond, Wash.

In some embodiments, the computing device 100 may have differentprocessors, operating systems, and input devices consistent with thedevice. For example, in one embodiment, the computing device 100 is asmart phone, mobile device, tablet or personal digital assistant. Instill other embodiments, the computing device 100 is an Android-basedmobile device, an iPhone smart phone manufactured by Apple Computer ofCupertino, Calif., or a Blackberry handheld or smart phone, such as thedevices manufactured by Research In Motion Limited. Moreover, thecomputing device 100 can be any workstation, desktop computer, laptop ornotebook computer, server, handheld computer, mobile telephone, anyother computer, or other form of computing or telecommunications devicethat is capable of communication and that has sufficient processor powerand memory capacity to perform the operations described herein.

In some embodiments, the computing device 100 is a digital audio player.In one of these embodiments, the computing device 100 is a tablet suchas the Apple IPAD, or a digital audio player such as the Apple IPODlines of devices, manufactured by Apple Computer of Cupertino, Calif. Inanother of these embodiments, the digital audio player may function asboth a portable media player and as a mass storage device. In otherembodiments, the computing device 100 is a digital audio player such asan MP3 players. In yet other embodiments, the computing device 100 is aportable media player or digital audio player supporting file formatsincluding, but not limited to, MP3, WAV, M4A/AAC, WMA Protected AAC,RIFF, Audible audiobook, Apple Lossless audio file formats and .mov,.m4v, and .mp4 MPEG-4 (H.264/MPEG-4 AVC) video file formats.

In some embodiments, the communications device 101 includes acombination of devices, such as a mobile phone combined with a digitalaudio player or portable media player. In one of these embodiments, thecommunications device 101 is a smartphone, for example, an iPhonemanufactured by Apple Computer, or a Blackberry device, manufactured byResearch In Motion Limited. In yet another embodiment, thecommunications device 101 is a laptop or desktop computer equipped witha web browser and a microphone and speaker system, such as a telephonyheadset. In these embodiments, the communications devices 101 areweb-enabled and can receive and initiate phone calls.

In some embodiments, the status of one or more machines 101, 106 in thenetwork 104 is monitored, generally as part of network management. Inone of these embodiments, the status of a machine may include anidentification of load information (e.g., the number of processes on themachine, CPU and memory utilization), of port information (e.g., thenumber of available communication ports and the port addresses), or ofsession status (e.g., the duration and type of processes, and whether aprocess is active or idle). In another of these embodiments, thisinformation may be identified by a plurality of metrics, and theplurality of metrics can be applied at least in part towards decisionsin load distribution, network traffic management, and network failurerecovery as well as any aspects of operations of the present solutiondescribed herein. Aspects of the operating environments and componentsdescribed above will become apparent in the context of the systems andmethods disclosed herein.

B. Dynamically Modifying a Requested Web Page from a Server

Described herein are systems and methods for dynamically modifying arequested web page from a server at an intermediary for presentation ata client. The present systems and methods can provide real timeintervention via a cloud service or at an intermediary, upon receiving aclient's request for a web page of a server. The intermediary may managecontent and/or resources delivered to the client while communicatingwith the server to process or fulfill the request. The intermediary mayprovide a plurality of HTML fragments that can be assembled into amodified web page for the client, in response to the request. Thefragments may be delivered sequentially and in a controlled manner(e.g., as data is available at the intermediary and/or from the server),for processing by the client's browser and presented to the user. Thiscan lead to improved or enhanced system performance (e.g., using cachingmethods) and/or user experience.

The intermediary may be configured to inject or incorporate code into afragment for transmission to the client. The code may be executed by thebrowser (e.g., in the background) as the fragments are loaded orrendered as part of the modified web page. In some embodiments, the codemay be intelligently configured to perform certain actions that modifythe web page or affect some aspect of a resource of the web page. Theweb page may be modified to improve user experience. For example, thecode may, upon execution, pre-fetch a resource for faster loading at aright moment, provide cookie management for enhanced web-basedinteractions, incorporate third-party resources to a web page, or altercertain characteristics of resources. A requested web page may thereforebe modified dynamically at the intermediary and assembled at the clientwithout affecting how the server generates its web pages. Code injectedinto the fragments can execute in the background as each fragment isloaded onto a browser, altering web page features without the user evenrealizing. The code-based processing produces an improved userexperience, e.g., a richer experience with additional or custom content,an improved or more appropriate web page layout, or a more responsiveloading or rendering of web page elements.

Referring to FIG. 2A, one embodiment of a system for dynamicallymodifying a requested web page from a server for presentation at aclient is depicted. In brief overview, the system may include anintermediary between at least one client device and at least one server.The intermediary may include a web performance optimization system (WPO)291. The WPO may include a traffic processing system (TPS) 290, atraffic management system (TMS) 230 and a customizing user interface(UI) 280. The TPS 290 may include geographically-dispersed orcloud-based traffic processing units (TPU) 250. The TPS 290 may receiveand process HTTP (or HTTPS) requests and responses between a client anda server or website, and the TMS may manage routing of client requeststhrough the TPS. In the present disclosure, although HTTP may sometimesbe referenced by way of example, HTTPS or an alternative scheme iscontemplated and within the scope of this disclosure. A user or thirdparty may use the customizing user interface and/or an applicationprogramming interface (API) to query, add, remove and adjust a setting,status or configuration of the WPO system to achieve desired results.When a client issues a HTTP request to a server or website, the HTTPrequest may be directed to pass through the intermediary. Upon receivingHTTP request (e.g., via the TMS), the TPS may analyze the HTTP request(e.g., determine the client type), select and apply context-specificoptimization techniques to deliver appropriate fragments for assemblyinto a modified web page.

The intermediary may include a hardware device such as an appliance,network component, proxy, router, or any combination thereof. Ininstances where an intermediary device is referenced, the intermediarydevice may comprise any one or more of the above-mentioned components(e.g., TPS, TMS) within a single device or a collection of networkeddevices. Each of the components may embody hardware, or a combination ofhardware and software (e.g., program code executing on hardware of theintermediary).

The WPO can deliver dynamic content from an originating server to one ormore clients via partial object caching and client-side processing. Anobject may, for example, include a web page, and a partial object mayinclude a fragment of a web page. Instead of connecting to the serverdirectly, a client may communicate with the server via an intermediarydevice. The intermediary may store cached copies of content and otherresources from the server. The cached copies may have been identifiedand extracted based on prior interactions with the server and/or client.When a client requests for an object such as a web page, theintermediary may return a partial object from its cache almostimmediately, e.g., while the intermediary is requesting the object fromthe server.

The intermediary may employ client-side pre-fetch which allows the WPOto send a fragment or segment of an HTML page (e.g., the “head”) asquickly as possible in response to a request. This can accelerate theloading process by allowing a corresponding browser to start thedownloading and rendering process in parallel to the server-sideprocessing of the web page request. Once the object from the server isreturned responsive to the request, the intermediary may compare thereturned object to the delivered partial object from its cache. Theintermediary may find any differences based on the comparison, and maydeliver the differences to the client. In conjunction with or in betweendelivery of the partial object and differences, the intermediary mayprovide the client with client-side processing instructions or injectedcode. The client (e.g., a browser of the client) may execute the code orinstructions while loading or rendering fragments of the web page.

By way of example, embodiments of a method for dynamically modifying aweb page are depicted in FIGS. 2B and 2C. Referring to these figures, aprior request for a web page from a server may involve the followingillustrative HTML source file:

Original Source File <html>  <head>   <linkhref=“//www.foo.com/style.css” rel=“stylesheet” type=  “text/css”></link>   <script src=“//www.foo.com/jquery.js”></script>  <script src=“//www.foo.com/app.js”></script>  </head>  <body>  <!—ADDITIONAL/OPTIONAL MATERIAL -->  </body> </html>

Some portions of the web page may be cached by the intermediary. Oncethe page is in cache, and in response to a subsequent request for theweb page, the WPO system may respond immediately with a HTML fragment,for example up to the “<body>” tag from the cached copy (e.g., as shownin FIG. 2B):

Initial Part/Fragment Returned To The Client <html>  <head>   <linkhref=“//www.foo.com/style.css” rel=   “stylesheet”type=“text/css”></link>   <scriptsrc=“//www.foo.com/jquery.js”></script>   <scriptsrc=“//www.foo.com/app.js”></script>  </head>

The TPU may inject or incorporate code into the initial fragmentdelivered to the client. In the embodiment depicted in FIG. 2C, aninitial first fragment is not shown. In parallel, the Traffic ProcessingUnit (TPU) of the WPO system may convey the request for the webpage tothe server. When the TPU receives a response back from the server, theTPU may extract a difference or delta from the web page, relative to thestatic portion in the initial fragment, to form a second fragment. Thedifference or delta may include one or more dynamic portions of therequested web page. The TPU may add code, e.g., which may include a“<script>” block that can set any cookie that the server responded withusing a Set-Cookie header, to the response or second fragment (e.g.,YoResponse, as depicted in FIG. 2C):

Code injected into Subsequent Returned Part/Fragment To The Client<script>  //This code can be executed on a browser.  functionsetCookie(name, value, expires, path){   var exdate=new Date( );  exdate.setDate(exdate.getDate( ) + exdays);   varc_value=escape(value) + ((exdays==null) ? “” : “;  expires=”+exdate.toUTCString( ));   document.cookie=c_name + “=” +c_value;  }  //Set each cookie the server responds with. setCookie(“session”, “12312312312123”, new Date(2013, 12, 31), “”);</script>

If the code is added directly to the response received from the server,the TPU may, in this case, remove content that has already been sent tothe client (e.g., the initially returned part/fragment). The TPU maysend the remainder of the content (and the injected code) to the client,for example:

The Remaining Response  <body>   <!-- ADDITIONAL/OPTIONAL MATERIAL,e.g., dynamic portions   of the web page, injected code -->  </body></html>

Web pages may be made up of many different web resources that vary intheir content-type and purpose. Each web resource may be stored andrequested individually on a web server. This web page structure can makedeployment of web pages and websites easy. However, the issue with thisdeployment model is that the web browser may need to request each of theweb resources individually. The web browser may request one web resourceand then process it to see if other web resources are needed. If moreresources are required, the browser may request them one at a time andthen it will repeat the process. Today's websites typically require manyweb resources to create the interactivity and presentation envisioned bytheir designers. Ajax, Web 2.0, and Collaboration websites all lead toan increase in the interactivity and design required to acquire and keepcustomers. Developers may design and implement web pages by breaking upthe page into images, JavaScript, CSS, HTML, media (Flash, Sound, Video)and other resources. Developers do this in a way that makes it quick tobuild, debug, deploy, test, and maintain. This web page developmentprocess usually results in resources being broken down into specifictasks including, JavaScript files that implements a specific set oftasks, CSS files that manage the presentation of a certain section,component or element of a page, and images that display one graphicalelement of a page. However, browsers may be able to open only a limitednumber of connections to the web server. For instance, if the browsercan only create two connections with a web server, resource requests mayqueue up until a previous resource is completely downloaded.

Typically, the loading of the assets/resources may not happen until theend, after the last byte of a web page. This can waste significantamounts of waiting time, impairing user experience. The WPO can deliverthe initial fragment with injected code so that the browser can start toimmediately begin the parallelization process of downloading therequired assets. For example, the WPO may add JavaScript to the end ofthe first delivered fragment or HTML section (e.g., into a head section)to load resources or images, instead of waiting for the HTML thatinclude the images. Even certain resources referenced in the page bodymay be moved into the <head> tag. For a certain web page, the “head” orstatic portion(s) may be identified by a user via the UI of theintermediary. The WPO may re-order code/scripts that are loaded at theend of the web page file to the beginning. If the browser can beginloading assets, for example, within 100 ms or less from the request,there can be significant page speed increases.

The WPO may incorporate code into a web page fragment that canintelligently modify an aspect of the originally-requested web page. Forexample, upon execution, the code may direct specific images (e.g., of asocial plugin) from a website to load if and/or when these images areviewable to visitor. For example, images that are hidden in abackground, cached, or configured to be invisible, may be identified andexcluded/delayed by the code from loading and slowing down the pageload. Based on specific requirements, a user may configure the code tomanage images relative to a viewport. A viewport in a browser tab is theviewable area of a page. For example, a user may configure the code suchthat when a page on a website is loaded in a visitor's browser tab, allimages within viewport may be loaded immediately. A user may configurethe code to manage images such that only those images viewable to avisitor when the visitor scrolls on the page, may be loaded when inviewport.

In some embodiments, the WPO may incorporate code to load all or certainsocial plug-in scripts on a web page when the corresponding documentobject model (DOM) structure (e.g., HTML source) is ready. The WPO mayrecognize social plug-ins by their signature string. For example, aFacebook script tag may have a source attribute value:“//connect.facebook.net/en_US/all.js#xfbml=1”. In some embodiments, theWPO may incorporate code to load images in a web page slideshow when avisitor performs an action, e.g., clicks a *next* button. The WPO mayidentify such elements in a web page, for example, an image is aslideshow may have a CSS class “slide-img” and the next button may havea CSS class “slide-btn-next”.

In another illustrative example, a web page may place a quoted tweet inthe top half of a web page, but locate a related Tweeter script tag atthe bottom of the page. The WPO may incorporate code to advance orexecute the script tag so that the tweet may be fully functional whenloaded. The WPO may incorporate code to configure a social plugin scripttag to load when the corresponding social plugin is viewable.

In certain embodiments, the code may operate under a language frameworkor specification, which may be referred to as “AfterShocK” or “ASK”. Thespecification may provide for a number of system components. Forexample, AfterShocK may provide for components including a server-sideprogram/script (hereafter sometimes referred to as “Transformer”), and aclient-side script/program (hereafter sometimes referred to as“Executor”). The specification may include a language (hereaftersometimes referred to as “ASK lang”). ASK lang may be a domain-specificlanguage designed to configure an AfterShocK system. ASK lang mayprovide an interface for the Transformer and the Executor. ASK languagestatements may comprise a structural form of English or other languagewords, and in some embodiments, may be read naturally. The ASK lang canhelp bridge participants involved in an AfterShocK system, makingcommunication more efficient. ASK does not necessarily represent anyform of internal data structure in either the Transformer or theExecutor, nor intermediate data passing in between components. In oneillustrative embodiment, the ASK specification includes one or more ofthe following:

 DEFINE_STATEMENT ::= define IDENTIFIER VALUE   RULE_STATEMENT ::= forSELECTOR_STRING ACTION_STATEMENTS   ACTION_STATEMENTS ::=ACTION_STATEMENT | ACTION_STATEMENTS   ACTION_STATEMENT ::= doACTIONS_STRING EVENT_STATEMENT   ACTIONS_STRING ::= ACTION_STRINGACTIONS_STRING_REST   ACTIONS_STRING_REST ::= “” | “,” ACTION_STRINGACTIONS_STRING_REST   ACTION_STRING ::= FUNCTION_CALL_STYLE  EVENT_STATEMENT ::= on EVENTS_STRING   EVENTS_STRING ::= EVENT_STRINGEVENTS_STRING_REST   EVENTS_STRING_REST ::= “” | “,” EVENT_STRINGEVENTS_STRING_REST   EVENT_STRING ::= FUNCTION_CALL_STYLE  FUNCTION_CALL_STYLE ::= IDENTIFIER | “(” FUNCTION_CALL_STYLE_ARGUMENTS“)”   FUNCTION_CALL_STYLE_ARGUMENTS ::= “” |FUNCTION_CALL_STYLE_ARGUMENT | FUNCTION_CALL_STYLE_ARGUMENTFUNCTION_CALL_STYLE_ARGUMENTS_EXT   FUNCTION_CALL_STYLE_ARGUMENTS_EXT::= “,” FUNCTION_CALL_STYLE_ARGUMENT   FUNCTION_CALL_STYLE_ARGUMENT ::=STRING | NUMBER   KEYWORDS ::= define for do on   COMMENT ::=“#”.STRING.“\n”

By way of illustration, code based on the ASK specification may beimplemented as follows:

 define delay_time 5000  # Set delay_time to 5000  for“script[src*=‘facebook.com’]” do load on ready  # load script tag whichsrc attribute contains ‘facebook.com’ when ready  for “img.delay” doload on delay($delay_time)  # load img with “delay” class in $delay_timemillisecond after DOM ready  for “h2, h3” do log(“focus”), pass onviewable, mouseenter  # for h2 and h3 tags, log with tag “focus” toserver and pass on to the next rule,  # when they are viewable ormouseenter fired; this is a feature for Tag Management  for“div.content”   do append(“<img src=‘question.jpg’>”) on viewable   doredirect(“about.html”) on click(“button.about”)  # append “<imgsrc=‘question.jpg’>” tag to “div.content” tag when it is viewable and  #redirect the page to about.html when “button.about” is clicked

By way of illustration, data structures corresponding to the ASKspecification may be implemented or defined as follows. The datastructure may be an internal representation of AfterShocK states. It maywritten in JSON or another format.

RULE_CHAIN = [RULE] RULE = {  id: Number,  for: [SELECTOR],  act:RULE_ACTION } RULE_ACTION = {  do: [ACTION],  on: [EVENT], } ACTION,EVENT = {  name: “Action or Event name”,  args: [VALUE] } VALUE = { val: JSON }

The following illustrative definitions may be applied to the above datastructures:

ACTION may be one of:

load: load selected element.

pass: indicate this is not a final rule for selected element. When it isfinish processing in current rule, it may pass on to the next rule inthe rule chain.

EVENT may be one of:

ready: fire after DOM is ready, closely related to document ready eventin browser; ready event is equal to delay(0)

delay(ms:Integer): fire after *ms* millisecond of ready event

click(selector:String): fire when capture click event from elementselected by *selector*

viewable(selector:String): fire when capture DOM element is in viewportevent; If selector is omitted, then use target element instead

The following is an illustrative glossary of mentioned terms:

**Target Element**: DOM element on which actions may be apply

**Final Rule**: a Final Rule is the last rule applied to SelectedElement

**Selected Element**: element matched by selector

**Selector**: a subset of CSS selectors

**Element**: HTML element

**Rule Chain**: a list of rules, order by rule's ID

**Rule ID**: an unsigned integer number, higher number means higherpriority

**Rule**: action apply to selected element on event

In some aspects, the ASK server or Transformer maintains sessioninformation for the system. For example, the Transformer may keep trackof the client session and the third party session that are created. Eachthird party service may deliver cookies to the client. The Transformermay communicate these cookies to the service whenever a user requests apage. The Transformer may maintain component information for each page.When a page is processed by the TPU, the TPU may send information orinstructions on components that should be injected into the page, to theAfterShocK server. Based on the information/instructions, the server mayinject the correct components or resources, and may communicate with anyassociated third party services. By way of illustration, informationmaintained by the Transformer may be represented in the following:

{  “referer”: <URL-FOR-PAGE>  “session-id”: <Id of the clients sessionmaintained by aftershock, could be the same as the yottaa session> “components”: [{   “type”: {img, script}   “url”: <URL FOR THE SCRIPT>  “code”: <The block of code that specifies the component>  }, . . . ]

In certain embodiments, the ASK client or Executor may performasynchronous injection of a component, which may include a third partycomponent. The Executor may maintain the location of these components.By way of illustration, one embodiment of a configuration of theAfterShock client is as follows, and describes how to setup varioustypes of processing for various resources:

   var config = {     //The may load all resources after    defaultDelay: 5000,   log: true,     resources: [     // {     //url: “<The URL of the object to delay>”, //Matching of the URL is doneusing a contains and not a ==     // delayType: “{scroll, timer, none}”,    // delayTime: int //The number of milliseconds after the onload toload this resource.     // delayPosition: int //When the scroll barreaches this position it may be loaded.     // },     // EXAMPLES     //{     // “url”: “http://platform.twitter.com/widgets.js”,     //“delayType”: “defer”, //This may delay loading of the object until thetime specified by “delayTime”     // “delayTime”: 1000     // },     //{      // “url”: “http://connect.facebook.net/en_US/all.js#xfbml=1”,     // “delayType”: “lazy”, //This may delay the loading of the objectuntil the scroll position      // Will allow the users to track adifferent object then the supplied one. Helpful for loading JS when     // a UI component is visible.      // “delayPosition”: “<id or ifjquery is used on website a selector string>”      // },      // {     // “url”: “http://www.facebook.com/plugins/likebox.php”,      //“delayType”: “none” // skip the delay loading. Default - iframes      //}     // {     // “url”: “http://www.facebook.com/plugins/likebox.php”,    // “delayType”: “event”     // may use a similar string as backbonejs. <event> <selector>.     // Example: “delayEvent”: “click #mybutton”    // “delayEvent”:     // }  ] }

Changes to the configuration may be applied by making a call, e.g.,yo_configureAfterShock({ }).

Web pages may include one or more widgets, such as pixel tags, beacons,social media plugins, images, analytics trackers or agents, media files,and trust shields or badges. Examples of such widgets include: aVeriSign logo, Google analytics agents, Hubspot plugins, and Marketoagents. When WPO detects a widget from a web page, the WPO may direct arequest for JavaScript and/or images associated with the widget, to theWPO or TPU's optimizer for handling. Referring to FIG. 2D, a manner bywhich a widget may be handled by a browser in the absence of the WPOsystem, as well as via the WPO system, is depicted.

In some embodiments, the WPO may incorporate code into the modified webpage to handle the various types of widgets or plug-ins, including thirdparty widgets (e.g., from Facebook, Twitter and Pinterest). Categoriesof third party widgets include at least the following: (i) Widgets forFacebook, Twitter, Pinterest, Google+, Add this, etc.; (ii) Badges,logos or trust shields, for example, from VeriSign; (iii) Ads, forexample, resulting from Google ad words; and (iv) Beacons or agents, forexample, from Google Analytics, Marketo, etc. In some embodiments, theWPO may handle ads in a way that is simpler than the handling ofwidgets, e.g., allow ads to be delay loaded.

The WPO may allow for customization of a configuration of the code,e.g., by a user via the UI. For example, the WPO may allow a user toselect or identify specific widgets for targeted processing or handling.The WPO may allow the user to specify when the widget should be injectedor loaded onto the page (e.g., disable, X milliseconds after an onLoadevent). The WPO may allow a user to change or replace existing widgetinjection instructions, e.g., change <script src=“ ”> and inline<iframe> into asynchronous injected widgets. The WPO may allow a user tospecify a location within the page into which an <iframe> tag may beinjected.

In certain embodiments, the WPO may control the injection of widgets viaa JavaScript (JS). Javascript-based injection of a widget may bestandardized or implemented in the following manner:

 (function(d, s, id) {   var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id))    return;   js = d.createElement(s);  js.id = id;   js.src = “//connect.facebook.net/en_US/all.js#xfbml=1”;  fjs.parentNode.appendChild(js);  }(document, ‘script’,‘facebook-jssdk’));

The WPO may check or verify if such a script is already injected and ifnot, add, move, replace or otherwise modify the script into the headnode or section. The added/modified script can then handle the injectionand/or display of the widget.

In some embodiments, widgets may be injected via an iframe, for example:

$(“#here”).append(‘<ifr‘+’amesrc=“//www.facebook.com/plugins/likebox.php?href= http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;amp;width=292&amp;amp;height=590&amp;amp;show_faces=true&amp;amp;colorscheme=light&amp;amp;stream=true&amp;amp;border_color&amp;amp;header=true&amp;amp;appId=20152740944” scrolling= “no” frameborder=“0”style=“border:none; overflow:hidden; width:292px; height:590px;”allowTransparency=“true”></ifr‘+’ame>’);

The WPO or a user may identify (e.g., locate and indicate) the positionof the iframe, for example, via the UI. The WPO may include a library tolisten for changes to the DOM and implement the client-sidefunctionality. The library may be Javascript-based, and can be used tomanage the scripts and iframes discussed above. In some embodiments,widgets may be loaded in external JS files, and loaded within a sandbox.These widgets may be ignored, or handled differently or similarly tothat described above. For example, the widget injection code may bemodified to be inline, or the code may be injected into that JS file toaffect widget handling within that JS file.

In some web pages, deferring scripts may be incorporated and used todefer or delay an action, for example. Such scripts may be suboptimaland may delay page loading and/or consume system resources. Anillustrative embodiment is shown below:

<!-- Begin: 4q.iperceptions.com --><scriptsrc=“http://4qinvite.4q.iperceptions.com/1.aspx?sdfc=4b17eba0-8764-3a2c35d2-fbbc-45c0-ae78-5f89f694567e&amp;amp;lID=1&amp;amp; loc=4Q-WEB2”type=“text/javascript” defer=“defer”></script><!-- End:4q.iperceptions.com -->

The WPO may detect and may replace such scripts with the WPO's codeinjection method to efficiently control any deferral/delay using ASK,for example:

<script>  (function(d, s, id) {   var js, fjs = d.getElementsByTagName(s) [0];   if (d.getElementById(id))    return;   js = d.createElement(s);   js.id = id;   js.src =“http://4ginvite.4q.iperceptions.com/1.aspx?sdfc=4b17eba0-8764-3a2c35d2-fbbc-45c0-ae78-5f89f694567eamp;amp;lID=1&amp;amp; loc=4Q-WEB2”;  fjs.parentNode.appendChild(js);  }(document, ‘script’,‘facebook-jssdk’)); </script>

In addition, WPO may detect and may replace blocking scripts using theASK code injection method. For example, the following blocking script:

<script type=“text/javascript”src=“http://connect.facebook.net/en_US/all.js#xfbml=1”></script>may be replaced by or modified to:

<script type=“text/javascript”src=“dataUri:text/javascript;yo_loader(‘http://connect.facebook.net/en_US/all.js#xfbml=1’)”></script>

Alternatively, and in some embodiments, a blocking script may bereplaced with similar asynchronous code as discussed above to delay theloading of a resource.

With regards to handling of images, the WPO may handle these with HTMLinclusion of image tags. By way of example, the following:

<img src=“//cdn.optimizely.com/js/179843588.js>

may be changed into, or replace with the following example code snippet:

 <img src=“data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==”   onload=“yo_imageLoader(event)”  onerror=“yo_imageLoader(event)”yo_src=‘http://seal.stellaservice.com/seals/stellaservice_excellent.png?c=3010’   yo_delayType=‘scroll’

The WPO may use injected code to delay the loading of specific images.Using delay loading may be useful, for example, on blogs and productlisting pages, web pages that include many images. To handle images, theWPO may have to perform image selection. This may involve finding andidentifying the right images (e.g., to delay load), selecting multipleimages, and controlling an appropriate number of images to select. TheWPO may in some cases, use URL matching techniques to select images. TheWPO may perform image selection using a standard, custom or proprietaryquery language. The WPO may perform selection of images based on one ormore criteria, including DOM position, e.g., identifying a child of acertain element, since in some cases, an image may not have a style orother selectable attributes. For example, and referring to FIG. 2E, animage identified in the highlighted portion may have to be selected fromwithin a web page.

In some embodiments, all elements located after a certain position in aweb page may be selected for code-based processing. For example, in aproduct listing page, it may be desirable to delay the loading of imagesresiding in a secondary, or less important portion of a web page.

In some embodiments, the injected code may control the transitioningcharacteristics of an image being displayed or appearing on a web page.For example, the code may perform fade-in or fade-out of an image. Theimage may fade-in or gradually transition to visible state, e.g., when auser scrolls into a portion of the page at which the image is located.This can make the appearance/disappearance of an image less jarring. Thecode can, alternatively, direct an image to snap on or off screenwithout a gradual transition.

The WPO may identify and handle existing scripts or script tags in arequested web page. Script tags can block the loading of an applicationand can cause long delays in page load. The WPO may handle scripts orscript tags by code injection into the delivered, modified web page. Forsuch tags, the WPO may process these using ASK to provide thecorresponding code for injection. A script loader of the ASK client(e.g., yo_scriptLoader) may perform the actual loading of the scriptbased a configuration. By way of illustration, the following script tag:

<script src=“//cdn.optimizely.com/js/179843588.js></script>

may be changed into, or replaced with the following code snippet:

<script src=“data:text/javascript;plain,/*yo_delay*/” onload=“yo_scriptLoader(event)”  onerror=“yo_scriptLoader(event)” yo_src=‘//cdn.optimizely.com/js/179843588.js’  yo_delayType=‘timer’ yo_delayValue=‘1550’></script>

In some embodiments, the WPO may detect the insertion of a script taginto the DOM using the AfterShocK client library. The WPO may use thelibrary to manage or perform code/JS injection into the modified page,for example:

(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s) [0];  if(d.getElementById(id)) return;  js = d.createElement(s);  js.id = id; js.src = “//cdn.optimizely.com/js/179843588.js”; fjs.parentNode.appendChild(js); }(document, ‘script’,‘facebook-jssdk’));

Configuration of these components may be handled by the followingillustrative statements:

yo_configureAfterShock({ defaultDelay: 5000, resources:[{url:“//cdn.optimizely.com/js/179843588.js”, delayType: “timer”,delayTime: “5000”}] });

The WPO may identify and handle existing iframe tags in a requested webpage. Iframe tags may block the loading of an application and can causelong delays in page load. The WPO may handle iframe tags by codeinjection into the delivered, modified web page. For such tags, the WPOmay process these using ASK to provide the corresponding code forinjection. An iframe loader of the ASK client (e.g., yo_iframeLoader)may perform the actual loading of the iframe based a configuration. TheWPO may handle at least two types of iframe injection. By way ofillustration, the following iframe tag:

  <iframesrc=“http://seal.stellaservice.com/seals/stellaservice_excellent.png?c=3010”></iframe>  may be changed into, or replaced with the followingcode snippet:   <iframesrc=“data:text/html;plain,<html><body></body></html>”   onload=“yo_iframeLoader(event)”    onerror=“yo_iframeLoader(event)”yo_src=‘http://seal.stellaservice.com/seals/stellaservice_excellent.png?c=3010’    yo_delayType=‘timer’    yo_delayValue=‘1550’></iframe>

In some embodiments, the WPO may detect the insertion of a iframe taginto the DOM using the AfterShocK client library. The WPO may use thelibrary to manage or perform code/JS injection into the modified page,for example:

$(“#here”).append(′<ifr′+′amesrc=“//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;amp;width=292&amp;amp;height=590&amp;amp;show_faces=true&amp;amp;colorscheme=light&amp;amp;stream=true&amp; amp;border_color&amp;amp;header=true&amp;amp;appId=20152740944”scrolling=“no” frameborder=“0” style=“border:none; overflow:hidden;width:292px; height:590px;” allowTransparency=“true”></ifr′+′ame>′);

Configuration of these components may be handled by the followingillustrative statements:

yo_configureAfterShock({ defaultDelay: 5000, resources:[{url:“//www.facebook.com/plugins/likebox.php?”, delayType: “timer”,delayTime: “5000”}] });

The WPO may generate HTML fragments or injected code to handle waitingimages. For iframes and images, the WPO may allow customization of animage displayed while the component has not been loaded. By default, animage (img) may use a transparent 1 pixel gif, for example:

data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== and an iframe may use the following, forexample: data:text/html;plain,<html><body></body></html>

The WPO may allow customization of such default content for images. Forexample, the WPO may allow customization to provide a specific URL, sothat user of the WPO system may add a wait cursor via the URL to themodified page, for example. The URL may allow a data URI incorporationof data, inline to a web page. The WPO may allow customization toprovide an optimized version for each encountered image in the requestedpage. For example, if a user is requesting for a web page from a mobiledevice, the WPO may provide for an extremely compressed image that is nolarger than 2 kb in size, for example.

In some embodiments, the WPO may provide the code for injection. The WPOmay store or maintain a base code, which may comprise a configurationfor configuring or specifying the injected code. The injected code maycomprise the ASK client code. In some embodiments, injected codereceived by a number of clients for a plurality of web pages may be thesame or substantially the same. For example, a full or minimized versionof the ASK client code may be accessed from a database (e.g., of theintermediary), or from an online repository (e.g., via a URL), forincorporation into a web page fragment.

The WPO may provide a different configuration to each client and/or foreach web page, for example, to configure the injected code to behave oroperate differently between two clients and/or two web pages. In someembodiments, a configuration specific to a client and/or web page may beused to configure, specify or otherwise generate a piece of code at theintermediary for injection into a particular fragment. In other words,the injected code may be unique to a client (or user) and/or a web page.

By way of illustration, one embodiment of a base code or configurationis depicted below:

 {   “_id”: “51d32ddf63e31e2d9000074f”,   “name”: “AfterShock”,  “enabled”: true,   “last_modified”: “2013-07-02T19:45:57Z”,   “token”:“6”,   “_type”: “Platform::DocumentRule”,   “match”: [    {     “_id”:“51bb222a86305e35e90000f6”,     “name”: “URI”,     “type”: “0”,    “operator”: “CONTAIN”,     “condition”: “/”    }   ],   “actions”: {   “_id”: “51d32ddf63e31e2d90000750”,    “htmlInsert”: [     {     “_id”: “51d32ddf63e31e2d90000751”,      “enabled”: true,     “filters”: [ ],      “content”: “<script>//Fill in with the latestaftershock client code.</script>”     }   ],   “transformer”: [    {    “enabled”: true,     “comment”: true,     “merger”: true,    “item”: [      //See the Tag Handler Section     ]    }   ],  “asyncJs”: [ ],   “prefetch”: [ ],   “cssCombination”: [ ],  “jsCombination”: [ ],   “cssSprite”: [ ],   “urlRewrite”: [ ],  “dataURI”: [ ],   “badAssetRemoval”: [ ],   “responsiveImage”: [ ],  “clientPrefetch”: [ ],   “cssInline”: [ ],   “jsInline”: [ ],  } }

In some embodiments, the base code may be used to include the ASKclient, or to access the ASK client at the client/browser. In certainembodiments, the ASK client uses the base code to configure the injectedcode to operate in a particular manner at the client/browser. The basecode may incorporate, or be used to access code that performstransformation and/or optimization of an aspect of the page, which mayimprove user experience. The base code or configuration may be based ona default configuration and/or user-customization from default settings.A user, such as an administrator or a representative of a website, mayspecify or customize a configuration for a web page via a UI and/or APIof the intermediary.

In certain embodiments, the injected code may include one or more taghandlers. A handler may be executed or used to remove or replace aparticular script tag, process a widget, process a delay, etc. Anexample embodiment of a handler for removing or replacing <scriptsrc=“facebook”>, is as follows:

{  “type”: “1”,  “selector”: “script[src~.*all.*]”,  “content”: “<scripttype=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type = ‘text/javascript’; po.async=true;po.src = ‘//connect.facebook.net/en_US/all.js#xfbml=1’;var s =document.getElementsByTagName(‘script’) [0];s.parentNode.insertBefore(po, s);}) ( );</script>”   }

An example embodiment of a handler for removing or replacing <scriptssrc=“googleplus”>, is as follows:

{  “type”: “1”,  “selector”: “script[src~.*plusone.*]”,  “content”:“<script type=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type = ‘text/javascript’; po.async= true;po.src = ‘//apis.google.com/js/plusone.js’;var s =document.getElementsByTagName(‘script’) [0];s.parentNode.insertBefore(po, s);}) ( );</script>”   }

An example embodiment of a handler for removing or replacing <scriptsrc=“twitter”>, is as follows:

{  “type”: “1”,  “selector”: “script[src~.*twitter\\.com\widgets.*]”, “content”: “<script type=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type =‘text/javascript’; po.async =true;po.src = ‘//platform.twitter.com/widgets.js’;var s =document.getElementsByTagName(‘script’)[0];s.parentNode.insertBefore(po, s);}) ( );</script>”   }

An example embodiment of a handler for removing or replacing <scripttype=“text/javascript”src=“//assets.pinterest.com/js/pinit.js”></script>, is as follows:

{  “type”: “1”,  “selector”: “script[src~.*js\\/pinit.*]”,  “content”:“<script type=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type = ‘text/javascript’; po.async= true;po.src = ‘//assets.pinterest.com/js/pinit.js’;var s =document.getElementsByTagName(‘script’)[0];s.parentNode.insertBefore(po, s);}) ( );</script>”   }

An example embodiment of a handler for managing delaying of a plugin orwidget by a configurable delay value, is as follows:

{  “_id”: “51d1fb5e63e31e6724000b9c”,  “enabled”: true,  “filters”: [ ], “content”: “<script>window.yo_configureAfterShock({log:true,defaultDelay:500,resources:[{url:‘mon etate.net’,delayType:‘none’}]});</script>” }

An example embodiment of a handler for managing player.ooyala.comwidgets or media, is as follows:

{  “type”: “1”,  “selector”: “script[src~.*player\.ooyala\.com.*]”, “content”: “<script type=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type = ‘text/javascript’; po.async= true;po.src =‘//player.ooyala.com/v3/YjlhZDY1YzdkZDhlMGEzN2ZiMWU4OWI3’; var s =document.getElementsByTagName(‘script’) [0];s.parentNode.insertBefore(po, s);}) ( );</script>” }

An example embodiment of a handler for managing or tracking core metrics(e.g., relating to web traffic, user experience, etc.), is as follows:

  {  “type”: “1”,  “selector”:“script[src~.*coremetrics\\.com\\/eluminate\\.js.*]”,  “content”:“<script type=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type = ‘text/javascript’; po.async= true;po.src = ‘//libs.coremetrics.com/eluminate.js’;var s =document.getElementsByTagName(‘script’) [0];s.parentNode.insertBefore(po, s);}) ( );</script>” }

An example embodiment of a handler for managing or handling Facebookiframes, is as follows:

{  “type”: “1”,  “selector”: “iframe”,  “content”: “<iframeallowtransparency=‘true’ frameborder=‘0’ data-yo-delayType=‘lazy’src=‘data:text/html;plain,<html></html>’ scrolling=‘no’ data-yo-src=‘//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FUmbrellas-and-Beyond%2F133948556657323%3Ffref%3Dts&amp;amp;send=false&amp;amp;layout=button_ count&amp;amp; width=75&amp;amp;show_faces=false&amp;amp;font= arial&amp;amp;colorscheme=light&amp;amp;action=like&amp;amp;height=21’style=‘border:none;overflow:hidden; width:75px; height:21px;’></iframe>”}

An example embodiment of a reference to an “add this” widget, and anexample embodiment of a handler for managing or handling “add this”blocking, is as follows:

<script type=“text/javascript”src=“http://s7.addthis.com/js/250/addthis_widget.js#pubid=msadegursky” ></script>{  “type”: “1”,  “selector”: “script[src~.*js\\/addthis.*]”,  “content”:“<script type=‘text/javascript’>(function( ) {var po =document.createElement(‘script’); po.type = ‘text/javascript’; po.async= true;po.src =‘//s7.addthis.com/js/250/addthis_widget.js#pubid=msadegursky’;var s =document.getElementsByTagName(‘script’) [0];s.parentNode.insertBefore(po, s);}) ( );</script>”   }

By way of example, one embodiment of code injected to pre-load resourcesfor a webpage from a site called www.mywebsite.com, is as follows:

<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”><head> <script type=“text/javascript”> function yo_loader(url) { try{(new Image( )).src = url;}catch(e){ }  } </script> <scripttype=“text/javascript”>yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.7diamonds.com/v~1f/skin/frontend/7diamonds/7diamonds/images/free_shipping_and_returns.jpg”);yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.mywebsite.com/v~1f/media/wysiwyg/7_diamonds_shop_drop.jpg”);yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.mywebsite.com/v~1f/media/mconnect_uploadfiles/f/i/first_video.jpg”);yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.mywebsite.com/v~1f/media/catalog/category/button_downs_1.jpg”);yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.mywebsite.com/v~1f/media/catalog/category/sweaters_3.jpg”);yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.mywebsite.com/v~1f/media/catalog/category/kints_polos.jpg”);yo_loader(“http://d272okq92s0nye.cloudfront.net/50b52f8d4707e6603f000bd8/www.mywebsite.com/v~1f/media/catalog/category/newarrials.jpg”); </script> .. .  .

The above code may be injected into the first HTML fragment sent to thebrowser. The code may be injected at the beginning of the first HTMLfragment.

By way of example, one embodiment of code injected to handle cookies fora site called www.mywebsite.com, is as follows:

<!--INSTANTON COOKIES START--> <script type=“text/javascript”>document.cookie=“frontend=hrv4ncnv6e7upn25c7eqq37ea6; Expires=Tue,23-Jul-13 16:46:05 GMT;Path=/;Domain=www.mywebsite.com”</script> <!--INSTANTON COOKIES END-->

The above code may be injected into the second HTML fragment sent to thebrowser. The code may be injected at the beginning of the second HTMLfragment.

FIGS. 2F, 2G and 2H depict embodiments of a user interface (UI) toconfigure the intermediary for dynamically modifying a web page from aserver for presentation at a client. The user interface may comprise anapplication or a web-based interface, which may be accessible via theintermediary either remotely, or locally at a component of theintermediary. The user interface may allow a user to customize aconfiguration for a web page or web site. The configuration may be usedto configure code already injected into HTML fragments transmitted tothe client, or to configure code for injection into the fragments priorto transmission.

In some embodiments, the UI may provide access to an option for WPO todiscover any tags within a requested web page. WPO may automaticallyrecognize or identify different types of tags (e.g., iframe, image,script, video, object) via known signatures (e.g., URL patterns, DOMposition). The user may access a list of configured actions onidentified tags, with a status and an identification of tag-type foreach tag, for example as shown in FIG. 2F. By way of illustration,injected code may be configured to modify a default renderingcharacteristic of a tag, e.g., make an iframe tag load on-demand.Certain tags may be left un-optimized, e.g., without any configuredaction, or without any change to its default renderingcharacteristic(s). In some embodiments, a user may identify a tag toconfigure an action via injected code. The user may specify, via the UI,to identify a tag through a match or partial match with a string or URL,for example, as shown in FIG. 2G.

The user may direct the WPO to optimize the tag, e.g., based on the tagtype and/or a priori knowledge about the tag. The user may manuallyconfigure one or more actions. By way of example, and as shown in FIG.2H, a user may select available options for performing an optimizationaction, e.g., removal of tag, on-demand loading of the tag, cloudprocessing of the tag, conditional removal of the tag, or deferredloading of the tag. For on-demand loading, a tag may be configured to beloaded responsive to detection of a trigger, e.g., if an identified DOMelement that matches a certain string is visible and/or is accompaniedwith an event. For example, the event may include a user event such as amouse-over, mouse movement, or a click. With regards to deferredloading, the injected code can be configured to defer loading of anelement/fragment by a customizable delay, which may be determined fromthe time of the web page request, or a certain time period after adocument on-load event.

Referring now to FIG. 2I, one embodiment of a method for dynamicallymodifying a requested web page from a server for presentation at aclient is depicted. The method may include receiving, by an intermediarybetween a client and a server, a request from the client for a web pageof the server (201). The intermediary may transmit, responsive to therequest, a first fragment of the web page to include in a modified webpage for presentation at the client (203). The first fragment may bebased on cached data corresponding to a static portion of the web page.The intermediary may transmit a second fragment of the web page to theclient to include in the modified web page (205). The second fragmentmay include a dynamic portion of the web page provided by the server inresponse to the request. The intermediary may incorporate code into atleast one of the first fragment and the second fragment prior totransmission (207). The code may, upon execution as the correspondingfragment in the modified web page is presented to a user of the client,dynamically perform a predefined action to improve the user's experienceover that from the requested web page.

Referring now to (201), and in some embodiments, an intermediary betweena client and a server receives a request from the client for a web pageof the server. A browser of the client may generate the request based ona user action, such as a click on a link or an advertisement. Theintermediary may intercept the request from the client. The intermediarymay receive or intercept the request, comprising a HTTP or HTTPSrequest, from the client. In some embodiments, the client may beconfigured to transmit the request to the server via the intermediary.The intermediary may receive or intercept the request as a cloudservice. The intermediary may process the request as a service orfeature of an appliance, router, proxy device or any other networkdevice or system. A TMS of the intermediary may receive and route therequest to a TPS, embodiments of which were described above inconnection with at least FIGS. 2A and 2B. The TPS may reside in theintermediary or comprise a network device or cloud service. The TPS mayreceive and process the request, for example, prior to requesting theserver for the web page.

Referring now to (203), and in some embodiments, the intermediary maytransmit, responsive to the request, a first fragment of the web page toinclude in a modified web page for presentation at the client. Theintermediary may transmit the first fragment of the web page to forprocessing, assembly, loading, rendering, execution and/or presentationat the client, e.g., on a browser of the client. The first fragment maybe based on cached data corresponding to a static portion of the webpage. The TPS may access a cache of web page data corresponding to therequested web page. The cache may store or maintain web page datareceived from one or more servers, including the requested server and/ora mirror site of the requested server. The cache may store one or morecomponents of a web page that may be static, e.g., a header section ofthe page.

The static portion may comprise elements of the page that do not changebetween multiple requests, requesting clients, geographical locations ofthe clients, browsers and/or users, or that do not change over a certainperiod of time. The static portion may be identified, determined,detected and/or inferred by the TPS over one or more requests for theweb page. The static portion may be manually configured or identified bya user or administrator. In some embodiments, the static portion isidentified via a comparison between a cached copy of the web page and alater copy provided by the server. The TPS may immediately transmit afirst fragment of the page to the client, comprising the static portionof the page, for loading on a browser. Due to the availability of thisfragment within a short period of time from the request, a user of theclient experiences a more responsive and faster page load in associationwith the requested web page.

In some embodiments, the intermediary may transmit or convey the requestfor the web page to the server. The TPS may convey, direct, route orre-transmit the request to the server in parallel with the processing ofthe request at the intermediary. The TPS may send the request to theserver during, before or after processing the request at theintermediary. In some embodiments, the TPS may modify the request, orgenerate a new request for the web page or for a portion of the webpage. Responsive to the request, the server may generate a responsecomprising a web page, including a dynamic portion of the web page. Thedynamic portion may, for example, be specific to the user, the client,the browser, geographical location and/or the time of the request. Theserver may send the web page and/or a cookie in one or more responses tothe request. The server may send the one or more responses to the clientor the intermediary, e.g., as each response becomes ready to send.

The intermediary may receive the requested web page from the serverresponsive to the request, the web page comprising at least the dynamicportion. The intermediary may receive a cookie from the serverresponsive to the request. The intermediary may receive or intercept theresponse on behalf of the client (e.g., via Cname or DNS redirection).The intermediary may identify and/or extract the dynamic portion fromthe response. The intermediary may identify and/or extract a differenceor delta from the web page relative to the portion already returned tothe client. In some embodiments, the TPS generates or forms a secondfragment of the web page based on the difference/delta or the dynamicportion of the web page. The intermediary may form the second fragmentas soon as, or responsive to receiving the response from the server.

Referring now to (205), and in some embodiments, the intermediary maytransmit another fragment (e.g., a second fragment) of the web page tothe client to include in the modified web page. This fragment mayinclude a dynamic portion of the web page provided by the server inresponse to the request. The TPS may transmit the second fragment to theclient as soon as the second fragment is generated. The intermediary maysend or convey the cookie from the server to the client. Theintermediary may incorporate code (e.g., Javascript, VBScript,ActionScript, a plug-in implemented in a language such as C, C++, ascript referencing a browser plug-in, or a script referencing a nativemodule) in the second fragment to set (e.g., maintain, update and/oridentify) the cookie at the client for use in a further communicationwith the server.

In some embodiments, the intermediary may incorporate code in adifferent fragment (e.g., a third fragment) to set the cookie at theclient for use in a further communication with the server. This fragmentmay be transmitted prior to, responsive to, concurrent with, during orafter the transmission of the second fragment to the client. In someembodiments, the third fragment does not include or convey a dynamicportion and/or a static portion of the web page. The intermediary maytransmit the corresponding cookie with the third fragment, or transmitthe corresponding cookie in a message separate from the third fragment.

Referring now to (207), and in some embodiments, the intermediary mayincorporate code into at least one of the fragments (e.g., the first,second and/or third fragments) prior to transmission to the client. Thecode may be implemented with an appropriate programming or scriptinglanguage, such as Javascript, VBScript, ActionScript, a plug-inimplemented in a language such as C, C++, a script referencing a browserplug-in, or a script referencing a native module. The intermediary mayincorporate or inject a particular type, set and/or collection of codedepending on which fragment to which the code is being injected. Theintermediary may incorporate a particular type, set and/or collection ofcode depending on at least one of: data cached in connection with therequested web page, a feature or characteristic of the web page, therequesting user, a characteristic of the client and/or client browser(e.g., client/browser type, geographical location, language preference,etc.), any injected code already delivered to the client via a priorfragment, and a configuration of the intermediary and/or serverpertaining to code injection. The intermediary may inject or incorporatecode to replace or modify existing code or features in the requested webpage. For example, and in some embodiments, the intermediary maydisable, modify and/or replace existing deferring or blocking scriptswith Javascript code, as discussed above in connection with at leastFIGS. 2A and 2B. The intermediary may incorporate or inject the codeinline in a message (e.g., HTTP message), or in a separate script filereferenced or attached to the message.

The code may, upon execution while the corresponding fragment in themodified web page is presented to a user of the client, dynamicallyperform a predefined action to improve the user's experience over thatfrom the requested web page. The code may run, execute or be otherwiseactivated when the corresponding fragment is loaded or processed at abrowser or other application of the client. The browser or clientapplication may execute or run the code by loading the fragment. Thebrowser or client application may execute or run the code as thefragment is loaded. At least a portion of the code may remain active orcontinue to run after the fragment is loaded. For example, the code may,continuously or for a period of time, poll, monitor or detect an actionby the user, in the background. A portion of the code may execute aftera configured delay, or be triggered by a page load event, browser event,DOM event and/or user action.

The intermediary may incorporate code in a multipurpose internet mailextensions (MIME) multipart message. The code may be injected into aHTTP message. The intermediary may transmit the one or more fragments ina MIME multipart message (e.g., one or more of the subtypes of amultipart message). The intermediary may transmit the one or morefragments via any type of HTTP message. The intermediary may incorporatecode in a MIME multipart message to set the cookie at the client for usein a further communication with the server. The intermediary maytransmit the first fragment, the second fragment and/or the thirdfragment via MIME multipart messages to include in the modified webpage. The intermediary may transmit one or more of the fragments forassembly and/or processing at the client.

The intermediary may incorporate code based on a configuration of theintermediary. As discussed, the configured may be based on the clientdevice type, browser type, the user, the geographical location, etc. Theintermediary may incorporate code customizable via a user interfaceand/or an API. A representative of the server or website, or anadministrator, may customize the configuration based on knowledge of theweb page, e.g., obtained via analysis of past traffic. The code may beconfigured to dynamically perform a predefined action, e.g., using adefault and/or customized configuration provided by the intermediaryand/or a user. The code may be injected, added or incorporated tooperate at the client, e.g., in the background, without the user of theclient realizing that the code is present or running. The code may beinjected, added or incorporated to operate at the client, withoutrequiring a change or modification at the server, e.g., to generate theweb page. The code may be injected, added or incorporated to execute atthe client without affecting how the requested web page is generated andtransmitted. The code may be incorporated into the one or moretransmitted fragments, to modify or alter a feature or characteristic ofthe requested web page. The code may be incorporated into the one ormore transmitted fragments forming a modified version of the requestedweb page.

In some embodiments, the intermediary incorporates code that directs orrequests the client's browser to perform a certain action. Theintermediary may incorporate code that directs the client's browser torequest for web page data corresponding to the client's device orbrowser type. For example, the intermediary and/or the injected code maydetect that the client comprises a mobile device, or includes a browserwith limited capabilities (e.g., lack of support for Flash). By way ofan illustrative embodiment, the code may detect the client's device orbrowser type, or a capability thereof, via a client-agent attribute. Theclient-agent attribute may be configured in the client or included inthe request. The code may direct the browser to request for web pagedata, of the identified web page, corresponding to the client's deviceor browser type. For example, the injected code may request for aportion of the web page data (for the requested web page) appropriatefor the device/browser, e.g., that can be rendered on thedevice/browser.

In certain embodiments, the intermediary may incorporate code thatdirects the client's browser to request for another web pagecorresponding to the client's device or browser type. As describedearlier, the intermediary and/or injected code may detect that theclient comprises a mobile device, a large form-factor screen, or abrowser with specific capabilities and/or limitations. Based on thedetection, the code may be configured to direct or redirect the browserto request for a different web page, e.g., from the same web server or adifferent web server. For example and in some embodiments, the code maydirect the browser to request a different web page optimized for amobile device, a large-screen device or a touch-screen device. The codemay direct the browser to request a web page optimized for an operatingsystem of the device (e.g., iOS, Android, Windows, etc.) The code maydirect the browser to request a web page optimized for a particularbrowser, e.g., Internet Explorer, Safari, Chrome browser, Firefox, etc.Thus, the injected code can improve or optimize a user's experience bycustomizing web page content or source based on device/browserattributes.

The intermediary may incorporate code that affects an aspect of any oneor more resources for the modified web page. By way of illustration, andnot intended to be limiting in any way, a resource may include one ormore of: hypertext markup language (HTML) content or object, an image, acascading style sheet (CSS), a widget, a social media plug-in, ananalytics agent, a pixel tag, a beacon, a trust seal or badge, a mediafile, a script and an advertisement.

The intermediary may incorporate code that adds or modifies aconfiguration for including advertising in the modified web page. Thecode may detect if advertising is already provided for in the requestedweb page. The code may remove advertising, e.g., to improve page loadtime, or to exclude advertising material that is not relevant to theuser. The code may modify an existing configuration, e.g., changing anaspect ratio, size, shape, position, animation (e.g., transition effectsin presenting an ad or switching ads) of an ad. The code may controltiming or delaying of an ad relative to other elements of the page, orin response to a user event or a page load event. In certainembodiments, the code may include an ad by creating a configuration forthe ad, or modifying an existing configuration. In this way, the codemay be used to incorporate customized content that may be from a thirdparty. The intermediary and/or the injected code may also facilitateimpression matching and/or perform brokering with third parties like adexchanges, ad networks and ad agencies. Accordingly, the code mayimprove user experience by (i) providing access to relevant and/orcustomized content, goods and services via intelligentinjection/modification of ads, (ii) removing or limiting irrelevant ads,and/or (iii) affecting the presentation of ads based on device/browserattributes and/or particular events.

The intermediary may incorporate code that directs the client's browserto pre-fetch a resource to store in a local cache. The injected code maydirect or request the browser to fetch or access a resource (e.g.,image), in anticipation that the resource may be needed shortly. Forexample, the code may direct or request the browser to request and loada resource in a local cache (e.g., of the browser). This pre-fetch maybe performed in advance so that any impact from the access, transferand/or load times for the resource, which may impair page load duration,is minimized. One or more resources may be identified (e.g., via acustomized configuration) for pre-fetching. Suitable resources forpre-fetch may include certain large images and widgets, a related webpage, or resources originating from a server/database with a slowerresponse. By performing the pre-fetch in advance or in parallel withother page processing activities, the user's experience may be improvedwith the enhanced performance in loading the web page.

The intermediary may incorporate code that incorporates a third-partywidget or content into the modified web page. The injected code may beconfigured to include content relevant to a user or the requested webpage, without reconfiguring the server or how it generates its web page.Widgets from partners, such as third party analytics, may be added to aweb page so that a user's online activity (e.g., specific to that webpage or across pages) may be tracked and/or analyzed to improvecustomization of content and/or advertising relevant to the user. Suchcustomization can be performed in real time or introduced at a later,appropriate time. The code may also introduce popular social mediawidgets or plug-ins, for example, to encourage user interaction,interest and involvement in the web page. Certain trial widgets,features and/or content may be included on-the-fly via the intermediaryand/or injected code. For example, trial or limited rollout of a featuremay be targeted to specific users, time periods, geographical areas,etc., via dynamic web page modification using the present systems andmethods, without reconfiguring the end server. In some cases, thirdparty provided content or widgets may be more securely introduced at acloud service or intermediary, instead of being integrated withrequested the web page at the server.

The intermediary may incorporate code that controls a location of aresource in the modified web page. The injected code may identify anddetect particular resources that are less relevant or which may takelonger to load. The injected code may identify and detect particularresources that are more relevant or may be faster to load. The injectedcode may control the layout of content and other resources by modifyinga location of a resource in the web page. For example, the code maycontrol a location of a resource relative to that of another resource. Aresource may be re-located to the end of a web page so that it has moretime to load, e.g., before the user scrolls to the end of the page. Thecode may re-position a resource to highlight the resource to a user,consolidate similar resources within a portion of the page, or toimprove the layout of the page to the user.

The intermediary may incorporate code that controls a time instant forloading a resource to the modified web page. The injected code mayinitiate pre-fetching or caching of the resource to control the timeinstant for loading a resource. The code may delay or time the loadingof a resource, e.g., relative to the request for the web page, orrelative to a DOM, user or page load event. The code may replace ormodify an existing deferring or blocking script. The injected code maycomprise an asynchronous loading code. The latter may speed up pageloads by allowing asynchronous execution. The latter may prevent a pagefor being held up trying to load a resource if for example, a thirdparty site goes down or is slow. In some embodiments, the injected codecontrols a time instant for loading a resource into or from a localcache. For example, the code may direct a browser to load a resourceonto a page, but keep the resource in the background (e.g., withoutmaking the resource visible or active). In certain embodiments, theinjected code may control a time instant for loading a resource relativeto a DOM, page load or user event, e.g., a click, a mouse-over, contactwith a touchpad, a key entry, eye movement, scrolling action, etc. Theinjected code may controls a time instant for loading a resource, e.g.,an image or widget, when DOM is ready, or when the resource's locationis in viewport.

In some embodiments, the intermediary incorporates code that determinesa loading sequence for a plurality of resources. As discussed earlier,the injected code can determine a time instance and/or a position forloading a resource. The injected code can determine a time instanceand/or a position for loading a resource relative to another resource orto other resources. For example, the code can control a loading sequencefor a slideshow function. The intermediary and/or the code may be ableto identify or detect a larger image or other resource that should beloaded earlier (e.g., pre-fetched), or delayed (e.g., to avoid abottleneck in page load). The intermediary and/or the code mayincorporate or comprise an algorithm to select and/or order resourcesfor sequential and/or parallel loading.

The intermediary may incorporate code that controls a time instant formaking a resource visible or not visible to the user. The injected codemay control the time instant(s) and/or duration of a resource'svisibility, transparency or alpha-blending with other elements, whenloaded on a web page. The injected code may control the time andduration of transitioning effects (e.g., fade-in, fade-out) in making aresource visible or not visible to a user. The injected code may make aresource loaded in the background visible at a certain time or after acertain delay relative to a DOM or user event. The intermediary mayincorporate code that triggers loading or visibility of a resource basedon an action by the user, e.g., a click, a mouse-over, contact with atouchpad, a key entry, eye movement, scrolling action, etc. The injectedcode may control a time instant for making a resource visible or notvisible relative to the visibility of another resource. The injectedcode may control a time instant for making a group or collection ofresources visible or not visible to the user. In certain embodiments,the intermediary may incorporate code that triggers loading orvisibility of a resource based on a web page loading event. The injectedcode may control a time instant for making a resource, e.g., an image orwidget, visible when DOM is ready, or when the resource's location is inviewport.

Different portions or combinations of code may be injected based onexisting features, and customizable based on particular requirements.Different portions or combinations of code may be injected on-the-fly toone or more fragments, while a request for a web page is processed.On-the-page processing occurs as the individual fragments are loadedonto a browser. Accordingly, the present systems and method provide aplatform for dynamically modifying aspects of a requested web page thatimprove user experience.

C. Dynamically Managing Loading Priority or Sequencing of Fragments of aWeb Object

In some aspects, the present disclosure is directed to methods andsystems for dynamically managing delivery and/or loading priority offragments of a web object, sometimes referred to as applicationsequencing. In some embodiments, application sequencing refers to aprocess for orchestrating or managing delivery, as well as client sideprocessing (loading or rendering, which may include download to clientand browser loading) of web objects. This process may includere-arrangement of a sequence of items in a requested web object.Application sequencing may include defining fragments each comprising atleast a portion of an item, for delivery to a requesting client over aplurality of transmissions. Application sequencing may include amodification of default rendering characteristics of items in arequested web object. The application sequencing process may includere-prioritizing how each item of a requested web object may be deliveredand rendered in order to improve the web and mobile user experience. Theapplication sequencing process may include setting conditions/triggersfor delivery and rendering of each item of a requested web object inorder to improve the web and mobile user experience. Applicationsequencing, in some embodiments, includes one or both of the followingcomponents:

1. Delivery sequencing

2. Interaction sequencing

Application Sequencing Architecture

Referring to FIG. 2J, one embodiment of a system for delivering an itemof web content requested by a client is depicted. In brief overview, thesystem may include at least one intermediary between at least one clientand at least one server (e.g., web server). Application sequencing, bythe system, may be performed using at least one of the followingcomponents: a delivery sequencer in the intermediary, and an interactionsequencer operating on the requesting client. The delivery sequencer andinteraction sequencer may each comprise a combination of hardware andsoftware, or software executing on hardware (e.g., of the intermediaryor client).

The at least one intermediary may include a plurality of networkdevices, which may include one or more of a server, an appliance, agateway, a router, a proxy and a domain name service, as examples. Theintermediary may comprise embodiments of modules and/or featuresdescribed above in connection with at least FIGS. 2A-2D. Theintermediary may comprise a cloud-based platform and may providecloud-based services such as web object optimization, deliveryoptimization and user experience improvements. The intermediary maysometimes be referred to as Yottaa performance cloud.

In some embodiments, the intermediary may include a TPU, a configurationor set of settings, and/or a caching system. The caching system mayinclude and/or manage a cache for storing fragments or items of a webobject. For example, the caching system may access a local cache, aremote central storage module, or a storage area network (SAN). Thecaching system may be configured to track the validity of a storedfragment or item, and may assign or de-allocate memory to anitem/fragment based on a static or dynamic behavior of theitem/fragment. In some embodiments, the caching system may assign orde-allocate memory to an item/fragment based on a configuration orsetting of the intermediary. The configuration or setting(s) may beuser-defined and/or set by the intermediary based on prior traffic, andmay include any embodiment of the configuration 240 described above inconnection with at least FIG. 2A. For example, the intermediary mayinclude or have access to a configuration provided by a representativeof the web server. The intermediary may include or have access to adefault configuration or set of settings. The intermediary may include auser interface for a privileged person to configure the configuration orsettings.

The TPU may include embodiments of TPUs and/or features described abovein connection with at least FIGS. 2A-2D. The TPU may include a deliverysequencing engine/module, sometimes referred to as a delivery sequencer.The delivery sequencing engine/module may comprise a combination ofhardware and software, or may comprise software executing on hardware(e.g., a processor) of the TPU or intermediary. In some embodiments, thedelivery sequencing engine/module or TPU may define a plurality offragments for a requested item of web content, and may determine totransmit the plurality of fragments to the requestor over a plurality oftransmissions. The delivery sequencing engine/module or TPU may orderthe plurality of fragments in a specific sequence, and may deliver ortransmit the fragments according to the sequence. The deliverysequencing engine/module or TPU may define and/or order the fragmentsbased on cached items managed by the caching system for example. Thedelivery sequencing engine/module or TPU may define and/or order thefragments based on the configuration or settings.

Delivery Sequencing

Delivery Sequencing may involve one or more of: breaking a monolithicweb content unit into smaller units (fragments), re-prioritizing theorder of (and/or setting conditions for) delivery of these fragments,setting caching policy for each fragment, determining delivery timingfor each fragment, and delivering such fragments following there-prioritized order and delivery timing. The web content unit can beany web content object, such as an HTML document, an image, a CSS file,a Javascript file, a video file, an audio file, or an Adobe Flash or SWFfile. Delivery sequencing may be performed at the intermediary by thedelivery sequencer.

Interaction Sequencing

In some embodiments, interaction sequencing describes a process forimproving or optimizing rendering performance by controlling andstreamlining an order of rendering of various elements on a web page, ordifferent fragments of a web content item. The rendering of at leastsome of these elements may be conditional, e.g., based on triggeringevents. Rendering may include a process of requesting for, receiving,loading, executing and/or displaying an element on a web page, such asvia a browser. Rendering may include a process of interpreting code orinstructions, which may include HTML code, to load a portion or elementof a web page on a browser. Rendering may include assembly and/oraggregation of components and/or resources into an item for loading,execution and/or display as part of a web page. Rendering may include aprocess of embedding, incorporating or merging an item, resource and/orfragment into a context/portion of a web page. A browser may performrendering of an object, which may involve execution of a script orinstructions associated with the object. A browser may perform renderingof an object by accessing a graphical processing unit of the client. Insome embodiments, rendering includes a process of requesting a componentitem of an object (e.g., from a server), uploading the component item tothe requesting client, loading the component item into memory of theclient or a browser, and/or incorporating the component item into theobject.

Typically, a browser may render elements in a web page in theorder/sequence presented in the web page. For example, for HTML,rendering may start from the top of the page and proceed to the bottomof the page, until the entire page is rendered. Instead of following anormal standard rendering sequence for elements referenced in the webpage, interaction sequencing based on the present systems and methodsmay re-prioritize and/or set condition(s) for the rendering of variouscomponents so that important, required and/or available ones areprocessed immediately while the others may be deferred or processed asneeded. Interaction sequencing may be performed at the client by theinteraction sequencer. The interaction sequencer may comprise codeincorporated, injected or introduced by the intermediary into a portionof a web page that is loaded onto a browser.Injection/incorporation/introduction of executable code may compriseincluding or embedding the code, in part or in whole, into one or morefragments. Injection of executable code may comprise including a link,reference or locator in one or more fragments, so that the code may beaccessible in part or in whole.

Interaction sequencing may include various triggers for processingrendering of a page element, for example, but not limited to:

-   -   1. Visibility based trigger: The trigger to render a page        element may depend on whether the element is visible to the user        (e.g., within a viewing region of a browser or client display).    -   2. Event based trigger: The trigger to render a page element may        be based on a Document Object Model (DOM) event.    -   3. Timer based trigger: The trigger to render a page element may        be based on a timer. When the timer expires, the element can be        rendered.

Interaction sequencing can be applied to all kinds of web content types,such as: HTML document, image, video, audio, Javascript, CSS, Flash SWFfile, and so on. When the interaction sequencer detects such a trigger,it may initiate a “post-trigger” action for rendering of a correspondingelement. In some embodiments, the interaction sequencer implements apre-trigger action prior to detecting such a trigger. A pre-triggeraction may comprise at least one of: withholding rendering of theelement/fragment, displaying nothing (e.g., leaving a blank space or anempty object) at an identified location of the web page, and displayingat least one item. The at least one item may comprise at least one of:an indicator or message indicating that an item is loading, a temporaryor placeholder item or image, an advertisement, and a specialcall-to-action item. A call-to-action item may include a widget, imageor message for example that entices, motivates or suggests a user totake a particular action, e.g., click on the widget, or scroll the page.

HTML Sequencing

There can be many types of application sequencing, including HTMLsequencing. In some embodiments, HTML sequencing refers to a process forimproving delivery and rendering of an HTML document, which may becache-able or non-cache-able. The HTML document can be dynamicallygenerated by a web server, and may include dynamic and/or personalizeddata unique to the current session, time instant/period/zone, user,device, browser, geographic location, etc. The intermediary may notcache such data when identified and/or received at the intermediary.HTML sequencing may include at least one of the following components:

-   -   1. Delivery sequencing: This may be performed by the Traffic        Processing Unit (TPU), residing in an intermediary that        intercepts HTTP requests and responses between a client and a        web server. The TPU may perform one or more of the following:        split or break an HTML document into smaller fragments, generate        synthetic units based on these fragments, deliver the first unit        to the client browser quickly for processing, and store other        units for potential subsequent requests from the client. The TPU        may also inject executable code (such as JavaScript) into the        one of these units or fragments delivered to the browser. This        executable code may be configured to perform interaction        sequencing.    -   2. Interaction Sequencing: Interaction sequencing may be        performed by the injected executable code, sometimes referred to        as “UxSequencer”. UxSequencer may execute according to        configuration data (e.g., from the intermediary), and may        perform actions such as loading additional fragments for the        page, determining whether, how and when to render specific        fragments on the page, and/or specific HTML tags (including        third party tags), and how to render resources on the page (such        as images, video, objects, tables, etc.).

HTML sequencing can be applied to both dynamic web pages as well asstatic web pages. Dynamic web pages may comprise pages that arere-generated or updated by the web server often or at each request, andwhich may not be cached for direct re-use. Typically, this is becausethe page may contain (dynamic) personalized data that are unique to thecurrent session, or data that may change dynamically. Static pages arethose that may not change over a period of time (sometimes referred toas a Time to Live, TTL). A dynamic page may be assigned with a TTL of alow value (e.g., 1 minute) or zero. Static pages may be cached and thusmay not need to be generated by the web server, e.g., until the cache orpage expires (e.g., TTL becomes zero).

In one embodiment, HTML sequencing may be performed via one or more ofthe following steps:

-   -   1. A user may visit a web page via a browser (say, a page at        http://www.mysite.com/path/loggedin.html).    -   2. The browser may send an HTTP request to        http://www.mysite.com/path/loggedin.html.    -   3. An intermediary may intercept the HTTP request, and may route        it to one of its Traffic Processing Units (TPU) to process the        HTTP request.    -   4. The TPU may access its caching system to check if there are        data and sequenced fragments available for this page.    -   5. If nothing is found from the cache (or what was found from        the cache has expired, e.g., with TTL=0), then:        -   (i) The TPU may forward the HTTP request to the origin web            server for processing, and may wait for the web server to            respond.        -   (ii) Once the TPU receives the response from the origin web            server, the TPU may retrieve the returned HTTP document from            the HTTP response, may return it to the current visitor and            may perform sequencing in the background.        -   (iii) In the background, the TPU may use sequencing settings            for this site and this page, and/or other behavioral data            that may have been learned beforehand, to sequence this page            into small chucks, and may rewrite these chunks into            deliverable fragments.        -   (iv) Rewriting: the TPU may package the chunks and may            perform the necessary rewriting, such as:            -   1. Injecting executable code into the fragment, and/or            -   2. Remove a content block from the fragment and replace                it with a unique identifier or marker (sometimes                referred to as “fragment pointers”).        -   (v) The TPU may store some of these fragments into its            caching system with the appropriate TTL settings for each            one of them. Some fragments may have TTL value of a few            hours to a few days for example, but some may have a TTL            value of 0, meaning that such a fragment is dynamic and may            be retrieved from the origin server's response to the HTTP            request.    -   6. If cached fragments were found with a valid TTL, then the TPU        may send back a first fragment to the requestor immediately;        -   (i) If all fragments for this page have valid TTL (e.g., the            page has no dynamic personalized content), the TPU may not            need to forward the HTTP request to the origin web server.        -   (ii) If at least one of the fragments is marked with TTL=0            (dynamic), the TPU may forward the HTTP request to the            origin web server to retrieve a new copy of the HTML            document.            -   A. Once the new copy of HTML document is received, the                TPU may go through the sequencing steps outlined in Step                5 above again, and may update the cached fragments                appropriately.

The steps for delivery sequencing may be performed by the intermediary(e.g., the TPU). Once the first fragment arrives at the client sidebrowser, interaction sequencing may be performed. Interaction sequencingmay be performed by executable code injected into the fragment by theintermediary. The injected executable code (e.g., interaction sequencer)may use its configuration data to determine whether, when and how torender content (e.g., page elements) inside this fragment, andwhether/when/how to initiate additional fragments onto the page based onpage events:

-   -   If a page element is visible, interaction sequencer may render        it (including loading the resources the element may require);        -   The timing for rendering may be determined by the            configuration data for interaction sequencer. Rendering can            be immediate, deferred by a certain duration, deferred until            certain resources are rendered, or deferred until everything            (e.g., all required resources, or everything else) is            rendered;    -   If the page element is not visible, interaction sequencer may        initiate or sequence the element's rendering according to        configuration data (e.g., modified/configured rendering        behavior): deferred or on-demand as needed. The trigger for        rendering can be page events such as user interactivity or other        in-page activities. For example:        -   The user scrolls the page        -   The user clicks a button or link on the page        -   A timer expires        -   A change in a page element that fires a DOM event, etc.

When interaction sequencer is rendering an element, it may loadadditional resources required by the element. It may identify and/or useone or more fragment pointers to compose an HTTP request to the serverto download additional fragment(s) for processing. The followingincludes a few examples to illustrate how application sequencing may beperformed.

Application Sequencing Configuration

Application sequencing configuration data may specify how a website andits pages are sequenced. Application sequencing configuration data maycome from various sources, for example:

-   -   1. Rules built into the system (e.g., Yottaa Performance Cloud)        or intermediary    -   2. Page behavioral data collected during run-time production        data as well as data collected during training sessions (e.g., a        profiling process)    -   3. Sequencing configuration provided by system administrators,        site developers and/or technical support team. This may be done        by providing a web based user interface that the user can        configure or input sequencing settings directly. An example is        to provide a graphical user interface that the user can use to        select page elements, and apply sequencing configuration to that        element from the visual UI directly.        The configuration may guide or direct the intermediary to        configure a rendering characteristic for a page element, and/or        to modifying a default rendering characteristic of a page        element. In some embodiments, a configuration for a page element        may provide/answer/address one or more of the following:    -   1. Is this element static? If so, what is the TTL for this        element? Typically the TTL may be the same as the TTL of the        corresponding page itself    -   2. Is this element dynamic? If so, this element may have a TTL        value of 0, which means it should not be cached and should be        retrieved from the origin server's response (HTML document).    -   3. What is the trigger to render this element? The choices may        include:        -   1. Visibility based: render this element as soon as it            becomes visible;        -   2. Event based: render this element as soon as a particular            DOM event is fired;        -   3. User interactivity based: render this element as soon as            the user or web visitor takes a particular action on the            page;    -   4. Rendering behavior (sometimes referred to as post-trigger        action). The choices may include:        -   1. Render the element immediately (as soon as possible)        -   2. Render this element after a certain amount of waiting            time (deferred loading)        -   3. Render this element after all other elements have been            rendered

Example: Sequencing a Dynamic HTML Page

Consider a dynamic web page identified by URL“http://www.mysite.com/path/loggedin.html”. This HTML source code forthe page may look like:

HTML Source Code for “loggedin.html” <html> <head> . . . </head> <body><div id=“header” . . . > <img src=“logo.png”> <span>Welcome, CoachWei.Your last login was at 03:23:14am ET Mar 2 2013</span>  . . . </div><div id=“block1” . . . > <H1>This is content block #1</H1> . . . </div><div id=“block2” . . . > <H2>This is a content block #2<H2> . . . </div><table id=“block3” . . . > <H2>This is content block #3</H2> . . . .</table> </body> </html>

This page may contain many content blocks. Each content block cancontain its own resources. In this example, content block “header” maybe dynamically generated and may be personalized to the current loggedin user. Other content blocks may be static and not personalized. In atypical process, the browser may send the request to the web server forpage http://www.mysite.com/path/loggedin.html. The Web server mayreceive such HTTP request, find the session information and the userinformation, perform server side business logic processing and may alsoperform the necessary data lookups and queries. Eventually, the webserver may generate the above HTML document, and send this document backto the browser. The browser may start to process this HTML documentfollowing the standard processing order (typically line-by-line orelement-by-element, from the top to the bottom of the HTML document,including loading the necessary resources along the way). After allelements of this page have been processed and rendered, the page may beready for user interaction.

From a visual display perspective, the above page may be rendered in theillustrative embodiment as shown in FIG. 2K. When the page is displayedin the browser, a significant portion of content may be outside of theviewport or viewing region of the browser screen. The viewport maycomprise a viewing region or area of the browser or client device,viewable by the user. Content outside the viewport may not bevisible/displayed/viewable to the user, such as Content Block #2 and #3,as shown in FIG. 2K. However, such content may still have to be loadedand rendered as part of the page, which can slow down the page load andimpact user experience significantly.

In accordance with some embodiments of the present systems and methods,an intermediary may sequence this page according to sequencingconfiguration. The document may be broken into chucks and modified byinjecting executable code and appropriate unique identifiers or markers,resulting in, for example, five fragments as shown below.

Fragment 1: executable code yo-app-sequencer.js may injected and itsconfiguration settings may be injected as “yo-app-sequencer-config.js”.Further, the content of this fragment may be chosen using visibility orviewport-based detection: content that are initially displayed above thefold in the viewport are incorporated into this fragment. Content blocksthat are not visible (below the fold) may be stripped out as separatefragments with appropriate unique identifiers or markers (e.g., thatincludes URL strings) injected into this fragment:

Fragment 1 <html> <head> . . . <script type=“text/javascript”src=“//yo-app- sequencer.js”/><script> <script type=“text/javascript”src=“//yo-app-sequencer- config.js”></script> </head> <body> <divid=“header” . . . > <img src=“logo.png”> <span id=“welcome-user”yopath=“http://www.mysite.com/path/loggedin.html/?yoloc-id=welcome-user”></span>  . . . </div> <div id=“block1”yopath=““http://www.mysite.com/path/loggedin.html/?yoloc- id=block1” . .. /> <div id=“block2”yopath=““http://www.mysite.com/path/loggedin.html/?yoloc- id=block2” . .. /> <table id=“block3”yopath=““http://www.mysite.com/path/loggedin.html/?yoloc- id=block3” . .. /> </body> </html>

Depending on the sequencing configuration, fragment 1 may be set a Timeto Live from 0 to a few hours, a few days, etc. If the TTL is set to belarger than 0 and has not expired, the TPU can use the previously cachedfragment 1 to respond to future requests for this page without having towait for the origin server to generate a new page first, thussignificantly reducing the waiting time and providing an instant onexperience to the user. Once this fragment arrives at the browser, thebrowser can start rendering the page immediately.

Fragment 2:

Fragment 2 <span id=“welcome-user”>Welcome, CoachWei. Your last loginwas at 03:23:14am ET Mar 2 2013</span>Fragment 3:

Fragment 3   <div id=“block1” . . . > <H1>This is content block #1</H1>. . . </div>Fragment 4:

Fragment 4   <div id=“block2” . . . > <H2>This is a content block #2<H2>. . . </div>Fragment 5:

Fragment 5   <table id=“block3” . . . > <H2>This is content block#3</H2> . . . . </table>

In this example, fragment 1 may be selected by a visibility orview-port-based rule. It may be configured to be “static” with a TTLlarger than 0, which means the previously cached copy can be used. Itmay be displayed immediately. Fragment #2 may be configured to bedynamic with a TTL=0. It may be retrieved from the origin server'sresponse (HTML file). Fragment #3, #4 and #5 are all static, which meanspreviously cached (and unexpired) copies can be used.

Once fragment 1 is processed and rendered by the browser, theinteraction sequencer “yo-app-sequncer.js” may start to manageinteractions according to its configuration data. The configuration datamay for example specify to: (i) display fragment #2 as quickly aspossible; (ii) display fragment #3, #4 and #5 if necessary (e.g., apost-trigger action in response to a trigger), such as when they arebecoming visible when the user scrolls down the page (trigger).

When an HTTP request to this webpage is intercepted by a TPU, the TPUmay forward the request to the origin web server. However, it may lookfor a cached copy of fragment #1 for this web page. If it finds such acached copy, it may return the cached copy to the client immediately,and may not wait for the origin server to respond to the initial HTTPrequest. Once this fragment arrives at the browser, the browser canstart rendering the page immediately, providing a responsive userexperience. Once the origin server returns an HTTP response, the HTMLdocument from the response may be used to reconstruct all fragments, andmay replace previously cached copies with an updated TTL policy for eachfragment for future usage.

Upon rendering of fragment #1, interaction sequencer yo-app-sequencer.jsmay immediately scan the page for unique identifiers or markers, andprocess them according to the configuration. For example, it may findthe marker for fragment #2. Because fragment #2 may be configured to bedisplayed as soon as possible, it may immediately fire an HTTP requestin the background to the server to retrieve fragment #2. This requestmay be constructed using the unique identifier or marker discovered,which may be:yopath=http://www.mysite.com/path/loggedin.html/?yoloc-id=welcome-user

When this request is intercepted by the intermediary, the processing TPUmay access a cache to check for fragment #2 according to the informationprovided by the unique identifier or marker. If the TPU finds fragment#2 in cache and the corresponding TTL is valid, the cached copy may besent back to the client. If not, the TPU may wait for the origin serverto respond to the initial HTTP request to retrieve the web page. Oncethe response is returned/received, the TPU may extract the correspondingsegment from the response webpage as fragment #2, and return this to theclient. The client side executable code may take the returned responseand replace the HTML element with the returned DOM element. As a result,the user may for example see a personalized welcome message and his lastlogin date and time displayed/updated in the browser, based on thereturned DOM element.

In some embodiments, interaction sequencer yo-app-sequencer.js may notdo anything proactively for other fragment unique identifiers or markersdetected or discovered on the page, because the corresponding fragmentsmay be configured to be loaded as needed. If the user does not scrollthe page, these fragments may not need to be loaded, thereby savingsignificant bandwidth and/or avoiding unnecessary processing on thesefragments. In some embodiments, the interaction sequencer may perform alimited or predefined amount of processing in connection with otherfragment unique identifiers or markers (e.g., for unique identifiers ormarkers nearer or proximate to the corresponding viewport), inanticipation of a scrolling action or other trigger, for example.

By way of illustration, responsive to the user scrolling the page, or tosome other event occurs that causes a fragment to become visible, theinteraction sequencer may use the unique identifier or marker toconstruct an HTTP request. The interaction sequencer may send or directthis request to the server to retrieve the corresponding fragment.Although the request may be addressed or directed to the server, the TPUmay intercept and/or process the request. The HTTP request may beintended for the TPU, and may be generated such that the TPU recognizesthe appropriate processing and/or response for the request. In someembodiments, the server may not understand the request and may not beable to directly handle the request. The TPU may go through a similarprocess to locate the requested fragment (e.g., from cache or from aresponse sent by the server) and return it to the client. In someembodiments, the TPU may wait for a response from the server, and maygenerate a fragment requested by the HTML request, based on theresponse. In certain embodiments, the TPU may request for or retrieveresources for the requested fragment (e.g., from the server, a cache, athird-party service, or a different network device/location). The TPUmay generate and/or return the requested fragment, responsive to therequest. The client side interaction sequencer may replace a placeholderobject and/or a unique identifier in the page with the returned HTMLfragment, or otherwise render the fragment.

A loading icon, loading message or loading status indicator may beinjected into the placeholder (or as the placeholder) for each fragment.While the fragment is being loaded, the user can see the loadingindicator as a visual feedback, thus improving the overall userexperience.

JavaScript Sequencing: Introduction

In association with Javascript optimization and other aspects describedin this disclosure, it may be helpful to identify factors that canaffect web performance. Every web application may require satisfactoryperformance in order to be functional. Every web application may haveits own context such that different factors may influence performancedifferently. Since the beginning of the web, there have been manyperformance tuning endeavors responding to what a particular contextcalls for. A good metric to gauge web performance may be page loadingtime. Page loading time refers to the time from when browser issues thepage URL request to the moment when the page is loaded, rendered andready for user interaction. Page loading time may be determined by threefactors:

-   -   Server processing time: the amount of time that the server takes        to process a page request and deliver the response to the        client;    -   Network transfer time: The amount of time that it takes to        transfer the content from one end point to the other end point;    -   Front end processing time: the amount of time that the client        (browser) takes to process the content it received, including        parsing, loading additional resources when required and        rendering.

Given that web applications may be distributed across web server,network and web browser, all of the three factors can play a role inperformance. However, the relative importance of each factor isdifferent, which is largely related to the web architecture.Historically, the web architecture was server-centric. All (or almostall) intelligence stayed on the server side and there was very littleintelligence on the client side. The browser may require very little“intelligence” besides acting as a “dumb display terminal”. Further, webcontent were mostly plain HTML pages that consume very little networkresources to transfer. In this model, the performance bottleneck wastypically on the server side and server processing time may be thebiggest performance factor. As a result, most of the earlier webperformance optimization efforts focused optimizing server sideprocessing, such as using more powerful servers, database tuning,optimizing server side logic, etc.

As web pages grew richer, the number of external objects, such asgraphical images, included in web pages started to grow. Becauseexternal objects require network round trips, the impact of networktransfer started to become more visible, especially when transferringcontent internationally. HTTP caching was adopted to alleviate thenetwork impact. Further, content delivery services (CDN), which aremostly based on HTTP caching techniques, grew into an industry dedicatedat improving network performance for delivering web content.

Over the last several years, there is a so-called “Web 2.0” evolution.Driven by a need to deliver a richer user experience, the web'sarchitecture has shifted away from being 100% server-centric into anarchitecture that leverages both client side and server side processingpower. Putting data and intelligence to where the user is atsignificantly improves user experience by reducing server round trips.As a result, in today's web 2.0 environment, the client side is takingon more data and computation. From 1995 to 2008, the size of an averageweb page has increased 22 times, and the number of external objects perpage has grown 21.7 times. From 2003 to 2008, the average web page grewfrom 93.7K to over 312K (233%) and the number of external objects in theaverage web page nearly doubled from 25.7 to 49.9 external objects perpage. Because JavaScript may be a main supported way to implement clientside intelligence, today's web applications tend to employ a significantamount of JavaScript code.

Consequentially, this Web 2.0 evolution significantly changed thecomparative importance of web performance factors. For the first time,front end processing time is becoming the biggest factor in webperformance while server side processing time and network transfer timeare both becoming secondary.

More specifically, among front end processing, client side JavaScriptcode is becoming one of the top influencers on the overall performancedue to the increasingly dependency of web applications on JavaScript. Inorder to understand how the front end, especially JavaScript, isimpacting web performance today, some typical web pages were studied.The following table shows content composition of the front pages of twoillustrative web sites, American Airline (www.aa.com) and FaceBook(www.facebook.com):

TABLE 1 Content Composition of Selected Web Sites Facebook.com aa.comfront page Size front page Size (%) (%) Total footprint: 810 KB (100%)687 KB (100%) JavaScript: 334 KB (42%) 532 KB (77%) HTML 182 KB (23%) 23KB (3%) Images (.gif, .jpg, .png) 201 KB (29%) 78 KB (11%) CSS files 69KB (9%) 45 KB (7%)

In both cases, the initial HTML text is only a small percentage of thepage footprint (23% and 3% respectively). This may be generally true forweb pages today. Secondly, the biggest portion of both pages isJavaScript, at 42% and 77% respectively. It is not uncommon to find websites today that JavaScript comprises 40% to 90% of the footprint.

Further, as recognized by the present systems and methods, the front endmay be where majority of the page loading time is spent for today's webpages. For example, by studying some major web sites, examples of frontpage loading times are as shown in table 2. The result show that, onaverage, only 5% to 20% of the page loading time may be caused by serverprocessing and network transfer of the initial HTML content, while up to90% of page loading time is spent processing the content.

TABLE 2 Some Major Web Site Front Page Loading Time Distribution TimeRetrieving HTML Time Elsewhere Yahoo! 10% 90% Google 25% 75% MySpace 9%91% MSN 5% 95% ebay 5% 95% Amazon 38% 62% YouTube 9% 91% CNN 15% 85%

As a result, consistent with the present disclosure, a recommendation orproposed rule is to optimize front-end performance first, that is where80% or more of the end-user response time is spent. For today's webpages, some or all of the following may apply:

-   -   The server time for generating HTML content and network transfer        time for such content may only be small factors in page        performance, typically only 5% to 20% of the page loading time.    -   Front end processing time can be as high as 95% of page loading        time.    -   HTML may only be a small portion of the footprint while        JavaScript can be a significant portion of the footprint,        sometimes as high as 80% to 90%;    -   JavaScript code performance can be the major performance        influencer.

In accordance with the present disclosure, one or more of the followingrecommendations or rules may apply in general:

-   -   1. Make Fewer HTTP Requests    -   2. Use a Content Delivery Network    -   3. Add an Expires Header    -   4. Gzip Components    -   5. Put Stylesheets at the Top    -   6. Put Scripts at the Bottom    -   7. Avoid CSS Expressions    -   8. Make JavaScript and CSS External    -   9. Reduce DNS Lookups    -   10. Minify JavaScript    -   11. Avoid Redirects    -   12. Remove Duplicate Scripts    -   13. Configure ETags    -   14. Make AJAX Cacheable

The significant popularity of Ajax contributed to widespread usage ofJavaScript. A substantial number of web 2.0 applications relies onJavaScript to deliver front end interactivity. A growing list ofJavaScript libraries (over 200+) are being created by various Ajaxdevelopers, some of which have gathered significant community adoption.Though the usage of JavaScript code can lead to significant betteroverall user experience, it can also bring problems if not usedproperly. Some of the common performance related problems are:

-   -   1. Sluggish network and runtime performance. It is common to see        web pages that load several hundred kilobytes of JavaScript. The        size of JavaScript libraries ranges from kilobytes to several        hundred kilobytes, or even megabytes. Big footprint introduces        not only longer download/parsing time, but also bigger client        side memory/CPU footprint. For some browsers, parsing/processing        large script can take an excessive amount of time.    -   2. The browser freezes from time to time. There are many cases        that JavaScript code can slow down the entire browser instance.        For example, too many JavaScript files that need to be loaded        may cause excessive number of network round trips; the execution        of a long running JavaScript function can block the browser from        responding to user events until the function finishes, etc.

In accordance with the present disclosure, techniques that may beemployed to improve JavaScript performance may include:

1. On-Demand Loading (Lazy Loading)

Instead of loading all JavaScript files up front, loading them only whennecessary can reduce the upfront network impact. A lot of JavaScriptlibraries provide such functionality, such as YUI loader and Dojo'spackage system.

2. Concatenation

Concatenation may be one effective way to reduce the number of roundtrips. Instead of loading different JavaScript files using separate HTTPrequests, concatenating these files into one file would enable all ofthem to be loaded using one HTTP request. Dojo ShrinkSafe and YUICompressor are two tools that can support file concatenation.

3. Minimization (and Obfuscation)

JavaScript programs are delivered to the client side as plain text whereit is compiled on the fly and executed. However, there are two downsidesof this approach. The first is code size. The source can containmaterials (such as whitespace and comments) that are not necessary forcode execution but rather for the purpose of aiding human readability ofthe code. Such materials have negative performance impact. The secondside effect is lack of code privacy. Given that the code is delivered asplain text, someone could read it, learn embedded techniques, and mayeven gather hints from the source code on how to compromise associatedsecurity.

JavaScript minimization and obfuscation are possible techniques to dealwith both issues. Minimization removes the comments and unnecessarywhitespace from JavaScript source code. Obfuscation changes the names ofvariables, functions, and members to strings that are harder tounderstand (and typically shorter). JavaScript tools typically implementsupport for both obfuscation and minimization. Some of the popular toolsare:

-   -   Dojo ShrinkSafe    -   YUI Compressor    -   Dean Edward's JS Packer    -   JSMin        Applying the above techniques, it may be possible to achieve a        footprint reduction of 20% to 50%.        JavaScript Sequencing (Hereafter Sometimes Referred to as        “Razor”)

In some aspects, the present disclosure is directed to methods andsystems for JavaScript Sequencing. JavaScript Sequencing may be referredto as a type or category of application sequencing, e.g., applicationsequencing as applied to JavaScripts or scripts and program code ingeneral. JavaScript Sequencing describes a process for JavaScriptoptimization. Unlike other JavaScript optimization techniques that arebased on static lexical analysis, Razor can use dynamic run-time profileinformation to achieve results of 60% to 90% savings. Razor orJavaScript Sequencing functionality may be provided in whole or in partby the intermediary and/or executable code injected into a web objectfragment. JavaScript Sequencing is developed in part based on at leastsome of the following observations:

-   -   1. JavaScript functions are the basic low level building blocks        of JavaScript code. Though typical JavaScript applications are        made up of JavaScript files, functions are at a lower level than        files because each JavaScript file is composed of JavaScript        functions. While current JavaScript optimization techniques        operates on a “file” level, performing optimization at the        function level could yield much better results;    -   2. At any moment of time, the browser may need only one function        because only one JavaScript function is executed at any moment        of time.    -   3. Theoretically, the application would work fine if we download        only one function at a time, right before the function is going        to be called. Other functions are not needed. These other        functions can stay on the server side without being downloaded        until they are going to be called. There is no need to download        all the code up front, and there may be no need to download them        immediately;    -   4. If only one function needs to be downloaded and stay on the        client side, we can achieve breakthrough savings in both        download size as well as client memory/CPU footprint, resulting        in significant performance improvements above any other        techniques.

In some embodiments, JavaScript optimization (e.g., via the deliverysequencer or TPU) using the present systems and methods sequences thedelivery of a JavaScript by breaking the Javascript into individualfunctions. The intermediary (e.g., via delivery sequencer or TPU) maygroup functions needed for specific use scenarios to be delivered “justin time” for that use scenario. For example, for the initial applicationpage loading, Razor may only download functions (e.g., to the client)that are necessary for the initial loading scenario by “trimming” otherfunctions from this initial download. This “trimming” process maysometimes be referred to as “raze”. After the initial download, if a“raze” function is needed, Razor can download this function on demand inthe background.

The Razor process may include an engine to analyze when/which functionis called during different run-time scenarios. For example, if thedelivery sequencer knows exactly which functions are called and whenthey are called during the initial application loading, the deliverysequencer can trim all other code from the initial download withoutbreaking the application. This would significantly save the initialdownload size and improve page loading performance. The knowledge of“when/which function is executed” can be achieved by profiling theapplication. By recording the profile data, Razor can have an accurateknowledge of the dynamic run-time behavior of the application beyondstatic lexical analysis for delivering breakthrough optimizationresults.

Razor Optimization Process

In some embodiments, Razor uses a three-step sequencing process tooptimize JavaScript code: profile, raze and run, as shown in FIG. 2L.

Profile:

During the “profiling” process, Razor may profile the application andrecord run-time information such as which functions are called, when afunction is called, the duration of each function call, and the callstacks etc. These recorded data may be used for the second step, “raze”.

Raze:

During the “raze” process, Razor may break the application into manysmaller parts at a function level, and re-build download units byassembling only these functions that are called during profile scenariosinto assemblies suitable for downloading. Before applying Razor, thedownload units are JavaScript files written by the developers. A browsermay issue a request for each JavaScript file to download it. With Razor,the download units may be assembled from scratch by removing the “notneeded” functions and adding these that are called during profiling. Asa result, all download units can contain only what is needed and exactlywhat is needed. For example, Razor may use the “initial loading” profilescenarios data to assemble the “initial loading” download unit. Thisunit may contain only these functions required for initial loading, andexactly these functions required for initial loading. These functionsmay be defined in different JavaScript files. Razor can pull them out ofthese JavaScript files and assemble them into the download unit.Functions are not called during any of the initial loading scenarios are“trimmed” from the initial download and are being kept on the serverside instead. When the Javascript application starts, the download unitassembled from the “initial loading” profile scenario may be sent to thebrowser. Because this download unit can contain all functions requiredfor initialization, this one HTTP request can be enough to satisfy theinitialization requirement. As a result, the number of JavaScript roundtrips may be reduced to 1 for the initial startup. Because only exactlywhat is needed may be downloaded, the corresponding download footprintmay be dramatically reduced as well. Further, “run-time profilescenario” data may be used for assembling run-time download units.Functions called during a run-time scenario, if not downloaded already,may be grouped together into one download package and may be downloadedwhen needed.

During the “raze” process, current JavaScript optimization techniquessuch as minimization, obfuscation and concatenation, etc., can still beapplied. FIG. 2M shows one embodiment of the “raze” process. By way ofexample, the process may “raze” functions that are not needed, and mayassemble new download units according to profile data.

Run:

When the application starts, Razor may load the initial download unit tostartup the application. At runtime, when a function is going to becalled, if the function has been downloaded to the intermediary already,the function may be invoked directly as usual. If not, Razor may checkto see if the function is in cache. If so, Razor may restore thefunction to its original status for invocation. If not, Razor maydownload the function on demand from the server side.

Optionally, the intermediary may be configured or specified to havecertain download units pro-actively streamed to the client side. Oncespecified, Razor (e.g., on the client side) may download these units inthe background as soon as the client becomes idle, without having towait until functions in these download units are invoked. Once afunction is downloaded to the client side, it may be cached andavailable for future usage.

Razor Optimizer

Embodiments of the present systems may include a Razor Optimizer, whichimplements the Razor approach for optimizing JavaScript applications. Insome embodiments, Razor Optimizer may be a part of the functionalityprovided by the interaction sequencer, or comprise a module or a scriptseparate from the interaction sequencer. Razor Optimizer may be acombination of hardware and software, or may include software executingon hardware of the intermediary.

In some embodiments, Razor Optimizer may comprise a web based JavaScriptapplication that runs in any browser. It may include a server componentand a client component. By way of illustration, and not intended to belimiting in any way, the Razor Optimizer client may comprise an Ajaxapplication based on Dojo 1.1. The Razor Optimizer client may resideand/or execute on the client. The Razor Optimizer server may comprise aJava web application that runs inside any Java Servlet container. TheRazor Optimizer server may reside and/or execute on the server (e.g.,web server). FIG. 2N shows one embodiment of a system for managingdelivery of web content, and provides an illustrative architecture ofRazor Optimizer.

Case Studies

By way of illustration, Razor optimization results from three differentapplications are presented here. By way of illustration, the threeapplications may include:

-   -   American Airline's web site (http://www.aa.com): this site uses        PrototypeJS JavaScript library, one of the popular Ajax        toolkits;    -   Razor Optimizer: This illustrative embodiment of Razor Optimizer        comprises a Dojo 1.1 based JavaScript application; and    -   jQueryUI demo (http://ui.jquery.com/functional_demos/): this may        be an application based on the popular jQuery library.

Table 3 shows an embodiment of some basic information about these threeapplications:

TABLE 3 Applications to be Optimized Ajax toolkit Total JavaScriptfootprint (byte) www.aa.com Prototype JS 294,124 Razor Optimizer DojoToolkit 1,158,664 jQuery UI Demo jQuery 151,151

Table 4 shows one embodiment of optimization results for these threeapplications. Razor achieved 67%, 75% and 62% savings for theseapplications respectively.

TABLE 4 Razor Optimization Results Original (byte) Razor (byte) Savingswww.aa.com 294,124 96,735 67% Razor Optimizer 1,158,664 292,203 75%jQuery UI Demo 151,151 56,904 62%

In comparison, Razor can deliver significantly better results than otherJavaScript optimization techniques. Using ShrinkSafe to optimize thesethree applications, the results would be 189 KB, 568 KB, and 86 KBrespectively (See Table 5). Razor may further cut down these numbers byhalf FIG. 2O depicts one embodiment of a comparison between JavaScriptoptimization results.

TABLE 5 Optimization Results Using Dojo ShrinkSafe Original ShrinkSafeSavings www.aa.com 294,124 189,618 36% Razor Optimizer 1,158,664 598,51148% jQuery UI Demo 151,151 86,173 43%

In general, Razor may be able to reduce application footprint by 60% to80%. In some embodiments, there can be at least three factorsdetermining page performance: server processing time, network transfertime and front end processing time. As the web becomes more interactiveand richer, front end processing time may become more and moreimportant. In the web environment we have today:

-   -   The server time for generating HTML content and network transfer        time for such content are only small factors in page        performance, typically only 5% to 20% of the page loading time.    -   Front end processing time can be as high as 95% of page loading        time.    -   HTML is only a small portion of the footprint while JavaScript        can be a significant portion of the footprint, sometimes as high        as 80% to 90%;    -   JavaScript code performance can be the major performance        influencer.

To optimize web performance, a proper approach may be to optimizefront-end performance first, which is where 80% or more of the end-userresponse time may be spent. For applications that use JavaScript, abottleneck may be in JavaScript. Properly profiling and optimizingJavaScript code using the disclosed methods and systems cansignificantly improve performance. Other JavaScript optimizationtechniques may leverage merely on static lexical data. There is stillsignificant room for improving these techniques, for example byleveraging on dynamic runtime information in accordance with thedisclosed systems and methods. In certain embodiments, Razor takesadvantage of both static lexical data as well as runtime profile data toachieve significant better optimization results than any other availabletechniques.

System Design

By way of illustration, the following describes aspects of a systemdesign for some embodiments of the present systems and methods. FIG. 2Pdepicts one embodiment of a method for application sequencing. Themethod illustrates some system interactions between a user operating aclient, an intermediary (Yottaa/AfterShock), a server (origin server orcustomer) and a third-party server. The system design may include aprototype software stack, which may comprise:

-   -   Node.js (e.g., v0.10)    -   Libraries        -   connect        -   request        -   jsdom # Server side DOM and browser simulation, for easy            manipulation and/or fast prototyping            System Components

Embodiments of the system for application sequencing may comprise anevent driven system. In the lifetime of a request/response transaction,the system may emit a plurality of events. An event which the systemhave been listening to may trigger one or more actions. An action (e.g.,post-trigger action) may comprise a fundamental operational unit. Anumber of optimization and transformation processes may be coded inaction.

An event may be initiated or fired during transition in the systemeither from the server or client side. From the interaction diagram asshown in FIG. 2P for example, and in some embodiments, there may be twoimportant events in the server side. These may include a) Requesting(e.g., UserRequest), which may happen when a user initiates a request,and b) Preprocess (e.g., Event Preprocess), which can occur afterreceiving a response from the original server. A Requesting event canprovide an opportunity (or trigger) for actions to manipulate and/orsend a request that may be sent to the original server. A Requestingevent can trigger an action to use cookies for monitoring, and/or relayHTTP requests in the cloud. On the other hand, a Preprocess event maytrigger or allow actions to transform a response body from the serverbefore sending it to the user. Actions operating responsive to thisevent may cut/remove or rewrite HTML elements so that they may be delayloaded in the user's browser.

At the client side, in some embodiments, triggers or events may oftentimes be HTML DOM events, such as readystatechange, DOMContentLoaded,Click, etc. There may also be events that are synthetic, from DOM eventsor client side script states. For example, a begin event can triggeractions (sometimes referred to as “post-trigger actions”) when theclient side application sequencing script is ready. A viewable event cantrigger when a monitored element comes within a viewport. For example,the interaction sequencer may listen to a scroll and/or a window-sizechange DOM event, as a trigger to initiate a post-trigger action.

Actions may be configured to have a similar programming environment atboth the client side and the server side. An action may use DOM and itsAPI to manipulate content. There may be no single entry point like themain function in the system, and actions may have to register to events.If preprocess of the body of a server's response is required, an actionmay have to listen to a server side Preprocess event. Similarly, someactions may have to listen to client events in order to be executed atthe client side.

Because actions can run in a serial fashion responsive to discreteevents, the system can provide a context for certain actions to save orstore states during different events. The context can work across aclient/server boundary. A context store may have to be carefullydesigned, since the store may be transferred to the client side (e.g.,if the action listens to at least one client side event). A contextstore that is too large may significantly impact client sideperformance.

In some embodiments of the present systems, there may be two types ofconfiguration, a server-side configuration and a client sideconfiguration. To configure the system, changes may be made to theserver-side configuration. The client-side configuration may begenerated or updated for each page after being processed by the server.Manually typing a client-side configuration in a page may be helpful fordebugging purpose, and valuable if the server-side implementationchanges. By way of illustration, one embodiment of a server-sideconfiguration is depicted as follows:

var yo_config = {  rules: [    {act:“tracking”},   {act:“load”,selector:“#clickimg”, on:{evt:“click”, selector:“#allsizes-photo”},processed:true},   {act:“load”, selector:“img”, on:{evt:“viewable”}},  {act:“load”, selector:“iframe”, on:{evt:“viewable”}},   //{act:“load”, selector:“#testimg”, fadein:false},   {act:“pauseXHR”,on:{evt:“begin”}},   {act:“resumeXHR”, on:{evt:“complete”}}  ], proxy_host: “http://localhost:8080/”  //proxy_host:“http://www.vwvortex.com/” };

This configuration may, in certain embodiments, comprise a JavaScriptfile that has an object named yo_config. The rules property of theconfiguration may hold a list of actions. Every action, duringexecution, can obtain its configured rule via a pass-in context object.By default, all actions may listen for a preprocess event.

By way of illustration, one embodiment of a Client-side configuration isdepicted as follows:

yo.client_config= {“events”:[  {“evt”:“click”,“selector”:“#allsizes-photo”,“refs”:[1],“actids”:[0],“evtid”:0,“emid”:0}, {“evt”:“viewable”,“refs”:[2,3,4,5,6],“actids”:[1],“evtid”: 1,“emid”:1}, {“evt”:“viewable”,“refs”:[ ],“actids”:[2],“evtid”:2,“emid”: 2}, {“evt”:“begin”,“actids”:[3],“evtid”:3,“emid”:3}, {“evt”:“complete”,“actids”:[4],“evtid”:4,“emid”:4}], “actions”:{ “0”:{“act”:“load”,“selector”:“#clickimg”,“processed”:true,“store”:{“refs”:[0]},“actid”:0}, “1”:{“act”:“load”,“selector”:“img”,“store”:{ },“actid”:1}, “2”:{“act”:“load”,“selector”:“iframe”,“store”:{ },“actid”:2 }, “3”:{“act”:“pauseXHR”,“store”:{ },“actid”:3}, “4”:{“act”:“resumeXHR”,“store”:{ },“actid”:4}}, “elements”:[ {“src”:“http://farm8.staticflickr.com/7341/9300157912_f47df0a759_b.jpg”},  { }, {“src”:“http://farm9.staticflickr.com/8550/9029806996_04befa585d_b.jpg”}, {“src”:“https://pbs.twimg.com/media/A7EiDWoCYAAZT1D.jpg”}, {“src”:“http://www.ccs.neu.edu/homeniang/img/header.jpg”} , {“src”:“http://imgs.xkod.com/comics/ice_sheets.png”}, {“src”:“http://imgs.xkod.com/comics/council_of_300.png”}]}

In certain embodiments, a client side configuration may be generatedafter a server-side preprocess event. The client side configuration maybe designed for context storage across a client/server boundary, and maybe used to provide settings for client side events. As shown in theexample, there may be three properties in a client-side configuration.These may include events to convey to the client script (e.g.,interaction sequencer) registering events, actions, which can be invokedwhen event fired, and elements, which may be used to store processedelement information. The configuration may be bounded toyo.client_config that is at the global scope accessible by some or everyscript in the page. All actions, events and elements may use an uniqueid for referencing (e.g., within a configuration).

Element Store:

In certain embodiments of the system, server side actions may modify thepage before it is passed to the client's browser. During this process,all elements that have one or more to-do-client-side actions may bemarked by an identifier. For example, when processed by a load action,an image element may become <img data-yo-ref=‘0’>. A client side loadaction may use the reference identifier to find its source (src)attribute in the element store. This feature may allow flexible designin both the server and client side. Actions can save as much data as maybe needed for referenced elements. This reference scheme may also helpimprove client side performance, because the client side system cancontinue to track a referenced element after a ready event. Thus, theremay not be a need use functions like document.querySelectorAll, toselect element(s).

Cookie Management:

In some embodiments, cookie management mainly involves resourceprocessing in the cloud, such as handling a pixel tag or sendingrequests. In some embodiments of the system, there may be two kinds ofcookies, a managed cookie and a third party cookie. A managed cookie mayinclude a cookie from a customer (e.g., server). As the name suggests, acustomer's traffic may be managed by the system, hence the system maymanage such cookies from the customer. On the contrary, a third partycookie may be transparent to the system. Browsers and third party sitescan keep these third party cookies. The system can follow the sameprotocols of handling a third party cookie in a latest version of theFirefox browser, in that it may not send and update a cookie for thirdparty sites, also known as “Block third-party cookies and site data” inChrome.

For cloud relaying purposes, some embodiments of the system mayintroduce two cookies to track a user browser and maintain a similarsemantic as today's browsers. The first cookie may be referred to asBID. BID may comprise an identifier of user's browser. Its expirationtime may be one year (e.g., to save tracking database size, a smallnumber may be deployed) and can update every time the browser visits amanaged site (a customer site, e.g. www.PCM.com). The second cookie maycomprise a session cookie (e.g., no expires property), SID. SID may berelated to BID in that SID may (only) serve as a signal of browsersession restart. When the system detects that a user has restarted thebrowser, all session cookies from managed sites may be trashed. The BIDand SID may not be forwarded to the managed site.

Certain embodiments of the system may include an action sometimesreferred to as tracking that implements this idea. When the trackingaction is enabled, it can maintain BID and SID cookies, and may addisNewBrowser and isNewSession, two boolean flags to the processingcontext, so that actions executed after tracking may know or have accessto a status of the current session, and can save data to the session orbrowser store, just like in a browser but on the server side.

In some embodiments, the system may provide logging for client-sideevents. The system's client side script can monitor many events. Theseevents may provide valuable information regarding users' behaviors.Logging for client-side events is a tool for this purpose. This loggingsubsystem may operate by monitoring a customer's events of interest,such as when a button is clicked, a div (e.g., a HTML division orsection) gets focused, etc. Then the subsystem may send trackingbehavior back to the system (e.g., periodically). The system may providean analysis of logs for a customer to understand their users' clientside activities.

Referring now to FIG. 2Q, one embodiment of a method for delivering anitem of web content requested by a client, is depicted. The method maysometimes be referred to as delivery sequencing. The method may be partof a method for managing delivery and rendering of an item of webcontent. One or more steps may be performed by a delivery sequencer. Inbrief overview, the method may include intercepting, by an intermediarybetween a client and a server, a request from the client to the serverfor an item of web content (301). The intermediary may split the item ofweb content into a plurality of fragments (303). The intermediary mayidentify, responsive to the request, a first fragment of the pluralityof fragments to transmit to the client (305). The intermediary mayinject executable code into the first fragment of the plurality offragments (307). The executable code may conditionally incorporateadditional fragments from the plurality of fragments into the firstfragment at the client.

In further details of (301), and in some embodiments, an intermediarybetween a client and a server may intercept or receive a request fromthe client to the server for an item of web content. The client may senda request to the server for an item of web content. The intermediary mayreceive or intercept the request as described above in connection withat least FIG. 2I. The intermediary may parse or otherwise process therequest to determine information about the request, for example the typeof request (e.g., the type of item or web content requested). Theintermediary may determine, based on the request, that the item of webcontent includes one of: an HTML or web page, an image, a cascadingstyle sheet (CSS), a script file, a video object, an audio object, and aflash file or small web format (SWF) file. For example, the intermediarymay determine that the item of web content includes an image file suchas a JPEG, TIFF, GIF or BMP file. As another example, the intermediarymay determine that the item of web content includes a script file orscript segment comprising JavaScript code, EMCAscript code, ActionScriptcode, visual basic code, a plug-in implemented in a language such as C,C++, code referencing a browser plug-in, or code referencing a nativemodule. In some embodiments, the item of web content may correspond toone or more types of HTML elements or groups, such as <img>, <video>,<object>, <div>, <script>, <table>, <stylesheet>, <iframe>, <p>, etc.

In some embodiments, the intermediary, via a TPS for example, interceptsthe request for the item of web content. The item of web content mayinclude dynamic or personalized information to be generated by theserver. The dynamic or personalized information may be generated basedon a context of a communication session between the client and theserver. For example, the dynamic or personalized information may bedetermined and/or generated based on an identity of a user operating theclient, a browser of the client, a device type of the client, a timeand/or date of the request, a geographical location of the client,and/or a type of browser for accessing the web content. By way ofillustration, the dynamic or personalized information may includeinformation for identifying or greeting the user on a corresponding webpage, shopping cart information for the user, and advertising targetingspecific users. The dynamic or personalized information may includevarious embodiments of dynamic information described above in connectionwith at least FIGS. 2A, 2B and 2I.

In certain embodiments, the intermediary may send, transmit, convey orforward the request to the server. The intermediary may send the requestto the server as described above in connection with at least FIGS. 2A,2B, 2C and 2I. In some embodiments, the intermediary may modify orotherwise process the request before sending the modified/processedrequest to the server. For example, the intermediary may modify thesource address of the request, e.g., so that the server may send aresponse to a destination identified by the modified source address. Theintermediary may send or transmit the request to the server during orbefore any one or more of (303)-(307). For example, the intermediary maytransmit the request to the server before or in parallel with sending afragment of the requested item of web content to the client. In otherembodiments, the intermediary may transmit the request to the serverafter sending a fragment of the requested item of web content to theclient.

In further details of (303), and in some embodiments, the intermediarymay split the item of web content into a plurality of fragments. Theintermediary may define or identify a plurality of fragments of the itemof web content. The intermediary may split and/or define the item of webcontent into a plurality of fragments before receiving the item of webcontent from the server. The intermediary may split and/or define theitem of web content into a plurality of fragments for delivery to theclient over a plurality of transmissions. The splitting may include theintermediary defining and/or identifying a fragment (e.g., a firstfragment) of the item of web content. Splitting may comprise separatingor partitioning the item of web content into a plurality of fragments(e.g., that may be combined or integrated together at a client tosubstantially include most or all features of the requested item ofcontent). Splitting may comprise a preliminary identification of aplurality of fragments, e.g., prior to receiving and/or processing therequested item from the server. This preliminary identification may bebased on prior and/or updated knowledge of one or more of: the server, aweb page served previously by the server, information in the request,and information associated with the client, browser and/or user, forexample. Splitting may comprise identifying portions of the requesteditem expected or predicted to be of certain/different types. Splittingmay comprise ranking, predicting and/or identifying portions of therequested item based on priority or a configuration, e.g., based on anexpected or likely order in which a user may want to access some or allof these portions.

Splitting may comprise a separation or partitioning of one or more priorcopies of the requested item, based on an evaluation of the one or moreprior copies of the requested item. The splitting and/or evaluation maybe based on a configuration, e.g., associated with the intermediary,server, user, client and/or item of web content. As part of thesplitting process or step for example, the intermediary may defineand/or identify a fragment of the item of web content in accordance withany embodiment of the steps discussed above in connection with at leastFIGS. 2B and 2I. The intermediary may define and/or identify a fragmentof the item of web content based on a portion or segment of therequested item of web content. The fragment may comprise a standaloneHTML message, for example. The fragment may be part of a MIME multipartmessage.

In some embodiments, the intermediary may define or identify a fragmentbased on a dynamic or static nature of the fragment, for example asdiscussed above in connection with at least FIGS. 2B and 2I. Theintermediary may split the item of web content into the plurality offragments based on a version of the item of web content cached by or atthe intermediary. The intermediary may split the item of web contentinto the plurality of fragments based on an unexpired and/or validversion of the item of web content or its fragments (e.g., stored in acache). The intermediary may define or identify a fragment of theplurality of fragments based on a version of at least a portion of theitem of web content stored or cached at the intermediary. For example,the intermediary may define or identify a portion of the requested itemas a fragment that includes static data, based on a cached copy of thefragment from a prior version of the requested item. The intermediarymay define or identify a portion of the requested item as a fragmentthat includes dynamic data, for example based on an absence orexpiration of a corresponding fragment from a prior version of therequested item in the cache. The intermediary may define or identify aportion of the requested item as a fragment based on a time-to-live(TTL) of the portion, for example a TTL inferred or assumed from a copyof the portion stored in cache for example. In certain embodiments, theintermediary may define or identify a fragment based on a configuration,for example, from the embodiments of configurations and/or settings asdescribed above.

The intermediary may define or identify a fragment based on informationabout one or more prior versions of the item of web content processed bythe intermediary. For example, a TPU of the intermediary may split,partition or segment a prior version/copy of the requested item into theplurality of fragments. The intermediary may define or identify aplurality of fragments based on identified fragments of a priorcopy/version of the requested item. The intermediary may define oridentify a fragment based on information about one or more priorversions of the item of web content received from the server. Theintermediary may define or identify a fragment based on informationabout one or more items of web content processed by the intermediary,the one or more items of web content having aspects or characteristics(e.g., web page structure) similar to the requested item of web content.

In certain embodiments, the intermediary may define or identify afragment of the plurality of fragments based on a response from theserver to the request. For example, the intermediary may split the itemof web content into a plurality of fragments based on one or moredynamic portions of the requested item returned by the server. In someembodiments, the intermediary may split the item of web content into aplurality of fragments based on a response from the server to therequest. For example, the intermediary may partially split the item ofweb content into one or more fragments based on cached data, and maysplit the rest of the item of web content into one or more fragmentsbased on a response from the server to the request. In certainembodiments or scenarios, the intermediary may wait for a response fromthe server to the request, to split response, comprising the item of webcontent, into a plurality of fragments.

In some embodiments, the intermediary modifies a default renderingcharacteristic derived from the server for each of the plurality offragments. Each of the modified rendering characteristic may include anaction and a trigger based on detecting one of: a user event, a timerevent and a document object model event, that involves a display or useof a corresponding fragment.

In further details of (305), and in some embodiments, the intermediarymay identify, responsive to the request, a first fragment of theplurality of fragments to transmit to the client. The intermediary mayidentify a fragment from the plurality of fragments to transmit to theclient. The intermediary may identify the fragment from a cache, e.g.,of the intermediary. The intermediary may determine, responsive to therequest, to transmit, send or deliver some or all of the plurality offragments to the client over a plurality of transmissions (e.g.,possible transmissions). Some of the transmissions may not occur, orsome of the fragments may not be sent to the client, for example,because a triggering event may not occur (e.g., the user may not scrollto or view one or more fragments).

The intermediary may determine to transmit some of the plurality offragments to the client, for example, conditionally or as needed at theclient. In some embodiments, the intermediary may deliver one or morefragments in a transmission to the client. The number of possibletransmissions in the plurality of transmissions may be different from,or the same as the number of fragments in the plurality of fragments.The intermediary may deliver a different number of fragments between twotransmissions to the client. The intermediary may determine an order oftransmission for the plurality of transmissions. The intermediary maydetermine an order of transmission for the plurality of transmissionsbased on the dynamic and/or static nature of data in the plurality offragments.

In some embodiments, the intermediary may determine an order or priorityof transmission for the plurality of transmissions based on at least oneof: a network condition, dependencies between related fragments, size ofa fragment, importance of a fragment, availability of a fragment, andvisibility of a fragment (e.g., in a viewport of the client or browser).For example, transmission of a smaller fragment may be preferred if alarger fragment may be inappropriate due to network congestion orbottleneck. Some related fragments may be transmitted within the sametransmission, or between proximate transmissions, for example to ensurethat related content or web-application functionality across fragmentsare readily available at the client. In certain embodiments, important,required or preferred fragments (e.g., headline news or alerts) aredelivered first to the client. A fragment that is available (or expectedto be available) earlier relative to another may be scheduled orprioritized for earlier delivery. In certain embodiments, a fragmentwith content that is expected to be visible to the user (e.g., within aninitial viewport of a browser or device), may be delivered to the clientbefore another fragment. The intermediary may identify a fragment (e.g.,a first fragment) of the plurality of fragments to deliver immediatelyto the client, based on any of one or more of the factors discussedabove.

The intermediary may determine the order of transmission for theplurality of fragments, but not all of the plurality of fragments may beeventually transmitted and/or needed. The intermediary may control theorder of transmission for the plurality of fragments, by generating afirst fragment and specifying a sequence or order for the remainingplurality of fragments/transmissions in the first fragments. Theintermediary may specify a sequence or order for the remainingfragments/transmissions, for example using unique identifiers or markersfor the remaining plurality of fragments in the first fragment. Theintermediary may arrange the unique identifiers or markers according tothe desired order or sequence of the remaining plurality offragments/transmissions. The intermediary may control the order for theplurality of fragments/transmissions based on any of the factorsdiscussed above. The intermediary may control the order for theplurality of fragments/transmissions based on a configuration for therequested item of web content, which may be user-specified. In someembodiments, some of the plurality of fragments are identified based ona prediction or expectation by the intermediary, and may not beeventually realized (e.g., based on the actual response from the serverto the request). As such, some of the unique identifiers or markersincorporated or injected into the first fragment may correspond to anon-existent or empty fragment, and may eventually be replaced by anempty object or ignored (e.g., by the intermediary and/or code executingat the client).

The intermediary may identify a fragment to deliver immediately to theclient, for example, without waiting for a response from the server tothe request. The intermediary may identify a fragment to deliverimmediately to the client, before or while sending or forwarding therequest to the server. The intermediary may deliver the first fragmentfrom a cache. The intermediary may identify a fragment to deliverimmediately to the client, comprising static data accessible to theintermediary (e.g., stored in a cache). The intermediary may identify afragment to deliver immediately to the client, to include or incorporatea script or executable code for execution at the client and/or browser.The intermediary may identify a fragment to deliver immediately to theclient, to be responsive to the request for the item of web content. Theintermediary may identify a fragment to deliver immediately to theclient, to enhance user experience in connection with the request forthe item of web content.

The intermediary may generate or construct the (e.g., first) fragmentbased on a cached copy or version of the fragment or request item. Theintermediary may form the first fragment based on a version of the firstfragment cached by the intermediary. The intermediary may store thefirst fragment in a cache, e.g., for handling future requests of theitem of web content. The intermediary may generate the fragment as a webmessage, e.g., a HTML, XML and/or XHTML message. The intermediary mayassign a TTL to the fragment. The generated fragment may include a heador header section and/or a body section. The body section may includeone or more divisions, sections or <div>'s. The fragment may include oneor more elements or groups, such as <img>, <video>, <object>, <div>,<script>, <table>, <stylesheet>, <iframe>, etc. The intermediary maygenerate the fragment to include one or more references or uniqueidentifiers or markers of additional fragments defined by theintermediary. Each reference or unique identifier or marker may beembedded in, or described by an annotation or statement in the fragment.The annotation or statement may include one of the following types ofstatements: <img>, <video>, <object>, <div>, <script>, <table>,<stylesheet>, <iframe>, etc. By way of illustration, one embodiment of aunique identifier or marker may include the following HTML statement:<div id=“div2” yopath=“mypage.html/#div2” . . . >.

In some embodiments, the intermediary performs at least one of thesplitting (e.g., in 305) and the identification (e.g., in 303), based ona (e.g., user-defined) configuration of the item of web content. Theintermediary may perform at least one of the splitting and theidentification, based on a configuration of a web page or the item ofweb content. The configuration may comprise a default configuration or adefault collection of settings. The configuration may be based on, orsupplement a default and/or system-generated configuration. Theconfiguration may be updated or further defined by a user, such as anadministrator or a representative of the server. For example, theintermediary may provide a user interface (e.g., web interface) to auser, to allow the user to identify an element and/or specify if anelement (e.g., <img>, <video>, etc.) may be static or dynamic. If anelement is static, the user interface can enable the user to specify aTTL value for the element.

In some embodiments, the configuration may be updated by ananalysis/learning engine of the intermediary. The intermediary mayinclude an analysis/learning engine to identify or predict the natureand/or number of fragments, e.g., based on changes in the content of therequested item over time. The intermediary may identify fragments basedon information provided by the server about content in the requesteditem, e.g., regarding the dynamic and/or static nature of portions ofthe requested items. The intermediary may determine or estimate a TTLfor a fragment and/or an element of the fragment, based on a history offragments processed and/or cached over time. In some embodiments, thehistory of fragments processed and/or cached over time may be based ontest/simulated results and/or real data. The intermediary may generate,provide or recommend a configuration (e.g., to a user, for a certain webitem/page/site) based on the analysis and/or learning performed by theintermediary on the server and/or versions of the item of web content.

In further details of (307), and in some embodiments, the intermediarymay Inject executable code into the first fragment of the plurality offragments. The executable code may be configured to conditionallyincorporate additional fragments from the plurality of fragments intothe first fragment at the client (e.g., based on one or more triggeringevents or triggers). The intermediary may inject, introduce orincorporate (hereafter generally referred to as “inject”) executablecode into a fragment (e.g., a first fragment) of the plurality offragments. The intermediary may inject executable code into a firstfragment delivered to the client and/or browser. The executable code maybe injected by way of instructions and/or a script added to thefragments, or by adding a link, reference or locator to instructionsand/or a script remotely accessible to the browser via the link,reference or locator (e.g., to a file or code segment). In someembodiments, the executable code may be injected into a head/header or abody of the fragment. For example, within a header section of thefragment, the executable code may be injected using a “<scriptsrc=”/path/sequencer.js”/> statement or annotation. Additional code forperforming other functions (e.g., for improving user experience, cookiehandling, interaction sequencing, etc.) may be injected in the same way,at the same location and/or at different location(s) in the fragmentand/or in additional fragment(s). In some embodiments, the injected codeis configured to perform one or more other functions.

The present methods and systems may configure and/or use the executablecode to control, manage, coordinate or direct the assembly, integrationand/or reconstruction of the requested item (or a modified and/oroptimized version of the requested item), for example from contentconveyed via multiple fragments. The executable code may conditionallyincorporate one or more additional fragments from the plurality offragments into the fragment at the client. As such, certain fragmentsmay not be requested and/or processed by the executable code (e.g., dueto a lack of corresponding triggering events to trigger renderingactions). The executable code may conditionally incorporate theadditional fragments during or upon executable/rendering by the browserat the client. The executable code may incorporate content from theadditional fragments received in one or more subsequent transmissions,into the first fragment. For example, the executable code mayincorporate content from one or more of the header and body of anadditional fragment, into a header and/or body of the fragment.

The intermediary may inject the executable code, comprising codeexpressed in at least one of: ECMAScript language or a language similaror related to the ECMAScript language, ActionScript language, visualbasic language and hypertext markup language. The executable code mayinclude one or more of: JavaScript code, EMCAscript code, ActionScriptcode, visual basic code, a plug-in implemented in a language such as C,C++, code referencing a browser plug-in, or code referencing a nativemodule. The executable code may include or be represented by a script,applet, program, instructions or software for installation and/orexecution on hardware (e.g., a processor) of the client. The executablecode may be accessed and/or executed prior to the browser processing abody or one or more divisions of the fragment. For example, theexecutable code may be initiated when the browser processes a header ofthe fragment, before the browser processes a body of the fragment. Thebody of the fragment may include one or more unique identifiers ormarkers for additional fragments. In some embodiments, the executablecode may be initiated or rendered with other elements in the fragment,in the order the fragment is processed by the browser (e.g., startingfrom the first HTML line of the fragment). In certain embodiments, theexecutable code may be initiated or rendered prior to other elements inthe fragment.

The executable code and/or browser may determine whether and/or apriority to deliver one or more of the additional fragments to theclient based on at least one of: a network condition, dependenciesbetween related fragments, size of a fragment, importance of a fragment,availability of a fragment, and visibility of a fragment. In someembodiments, the intermediary may Inject the executable code and aplurality of unique identifiers corresponding to the plurality offragments. The executable code and/or browser may parse or search thecontents of the fragment and/or body, to identify one or more uniqueidentifiers or markers. The executable code and/or browser may initiatean action for rendering of a corresponding fragment if a correspondingtrigger for the fragment (or corresponding unique identifier) isdetected. The executable code and/or browser may determine to deliverone of the additional fragments to the client responsive to at least oneof: a user event, a timer event and a document object model event, thatinvolves a display or use of the corresponding fragment at the client.

For example and in some embodiments, the executable code and/or browsermay identify, parse for, or search for one or more unique identifiers ormarkers within a region of the fragment (e.g., within a viewport). Theexecutable code and/or browser may ignore (or not look for) one or moreunique identifiers or markers outside of that region (e.g., beyond theviewport). During execution, the injected code may detect or identify aunique identifier or marker inserted by the intermediary into thefragment. The code may perform pattern recognition (e.g., regexpmatching) to detect or identify the unique identifier or marker. Forexample, the code may look for a text string that includes “yopath” oranother predefined pattern, alone or in conjunction with otheridentifying text string(s)/structure(s). The injected code may detect oridentify a unique identifier or marker based on a configuration, e.g.,provided via the intermediary. For example, the configuration may bedelivered to the client with the fragment injected with the code, or theconfiguration may be remotely accessible at the intermediary.

In some embodiments, the injected executable code may generate a requestat the client to the server for a second fragment from the plurality offragments responsive to detecting an event. The detected event maycorrespond to a unique identifier of the second fragment. The detectedevent may include one of: a user event, a timer event and a documentobject model event, that involves a display or use of the secondfragment. In certain embodiments, responsive to identifying a uniqueidentifier or marker (e.g., in a body of the fragment) and/or detectinga corresponding triggering event, the code may generate and/or send amessage/request (hereafter sometimes generally referred to as “message”and/or “request”. The code and/or browser may send or transmit a requestto the server based on the unique identifier or marker. The intermediarymay intercept the request for the second fragment, and the interceptedrequest for the second fragment may be prevented from reaching theserver. The request may be intercepted or received by the intermediary,for example similar to any of the steps described above in connectionwith (301). The request may be configured to be recognized and/orintercepted by the intermediary (e.g., TPU), even though themessage/request may be directed to the server. Responsive to receivingor intercepting the request, the intermediary may generate and/ortransmit a response to the request. The response may include a fragment(previously-defined by the intermediary and) identified by the uniqueidentifier or marker. The fragment may have been generated prior tointercepting or receiving the request. The response/fragment may begenerated based on a response received from the server and/or data froma cache accessible by the intermediary. For example, the intermediarymay form the second fragment based on a version of the second fragmentcached by the intermediary. In some embodiments, the intermediary maywait for the server's response, and may extract data for the fragment inresponse to the request. The intermediary may wait for a response fromthe server to the request for the item of web content, to generate thesecond fragment. In certain embodiments, the intermediary may generate amessage based on the request, and may send the message to the serverand/or another device (e.g., third-party server) for a resource toinclude in the fragment.

In some embodiments, the intermediary forms a second fragment of theplurality of fragments based on a response from the server to therequest. The intermediary may receive a response from the server, e.g.,in response to the request for the item of web object. The intermediarymay form the second fragment for delivery to the client. Theintermediary may send the second fragment to the client responsive tothe request for the second fragment. The intermediary may send thesecond fragment to the client responsive to the message generated basedon the unique identifier or marker. In some embodiments, the browserand/or the executable code receives and/or incorporates the secondfragment into the first fragment. The browser and/or the executable codemay determine that the second fragment corresponds to the uniqueidentifier or marker. In some embodiments, the browser and/or theexecutable code may wait to receive the fragment corresponding to theunique identifier or marker, before processing another unique identifieror marker. In other embodiments, the browser and/or the executable codemay process a plurality of unique identifiers or markers asynchronously,sequentially or in parallel, e.g., based on detection of thecorresponding triggers, without waiting to receive the fragmentcorresponding to a first unique identifier or marker.

The browser and/or the executable code may incorporate or insert atleast a portion of the second fragment (e.g., a body of the secondfragment) at the location of the unique identifier or marker. Thebrowser and/or the executable code may incorporate at least a portion ofthe second fragment into the first fragment to replace the uniqueidentifier or marker. The executable code may conditionally send aplurality of messages corresponding to a plurality of unique identifiersor markers (e.g., in the order identified/triggered within the firstfragment) to the server. The executable code may incorporate a pluralityof fragments transmitted by the intermediary in response to theplurality of messages, into the first fragment.

In some embodiments, the intermediary may update a cache based on aresponse from the server to the request for the item of web content. Theintermediary may form a second fragment of the plurality of fragmentsbased on a response from the server to the request, to store in a cache.The intermediary may determine whether to store the second fragmentbased on a TTL value of the second fragment. The intermediary maydetermine whether to store the second fragment based on the nature ofthe content in the second fragment, for example, whether the contentincludes static or dynamic data. The intermediary may determine ordecide to store the second fragment in the cache based on informationfrom the server indicating that content for the second fragment isstatic and/or having a certain TTL value (e.g., a non-zero value).

Referring now to FIG. 2R, one embodiment of a method for managingrendering of a web page in a browser is depicted. The method maysometimes be referred to as interaction sequencing. The method may bepart of a method for managing delivery and rendering of an item of webcontent. One or more steps of the method may be performed by aninteractive sequencer, a TPU and/or a delivery sequencer. The method mayinclude executing, by a client operated by a user, code within a firstfragment of a web page as the first fragment is presented to the user(401). The code may be injected into the first fragment by anintermediary between the client and a server of the web page. Theintermediary may have split the web page into the first fragment and aplurality of fragments. The intermediary may have modified a defaultrendering characteristic derived from the server for each of theplurality of fragments. Each of the modified rendering characteristicmay include a trigger and an action for rendering of a correspondingfragment of the plurality of fragments. The executing code maydynamically detect a trigger for rendering of a second fragment from theplurality of fragments (403). The trigger may include one of: a userevent, a timer event and a document object model event, that involves adisplay or use of the second fragment. The executing code may initiate,responsive to the detected trigger, a corresponding action for renderingof the second fragment within the first fragment (405).

In further details of (401), and in some embodiments, a client operatedby a user may execute code within a first fragment of a web page as thefirst fragment is presented to the user. The client may execute codewithin (a fragment of) the web page as the web page is partiallypresented to the user. In certain embodiments, one or more stepsdescribed in FIG. 2I and/or FIG. 2Q may precede (401). For example, thefragment(s) described in FIG. 2I and/or FIG. 2Q may be part of thepresent web page, or comprise the present web page. In some embodiments,the code described in FIG. 2I and/or FIG. 2Q may be part of the presentcode, or accompany the present code, or separate from the present code.For example, a single locator, link or reference in the web page (or afragment of the web page) may provide access to code for performingsteps in FIG. 2I, FIG. 2Q and/or FIG. 2R.

In some embodiments, the client sends or transmits a request to a serverfor the web page, for example as described above in connection with atleast FIGS. 2I and 2Q. The request may be received or intercepted by anintermediary between the client and the server, for example as describedabove in connection with at least FIGS. 2I and 2Q. The client mayreceive from the intermediary a fragment (e.g., a first fragment) from aplurality of fragments, the fragment incorporating the code. The codemay be incorporated into the web page by the intermediary between theclient and the server. The intermediary may comprise any embodimentsand/or features of the intermediaries described above in connection withat least FIGS. 2A-2C, 2I, 2J, 2N, 2P and 2Q. The intermediary may definea plurality of fragments for the web page, for example, as describedabove in connection with at least FIGS. 2I and 2Q.

In some embodiments, a browser or application of the client may executethe code. The code may be executed as portions of the web page orfragment (e.g., that includes the code) are rendered by the browser orapplication. In some embodiments, the code may be executed before otherportions of the web page or fragment are rendered or loaded. The codemay include one or more of: javascript code, actionscript code,hypertext markup code, visual basic code, a plug-in implemented in alanguage such as C, C++, code referencing a browser plug-in, or codereferencing a native module. A browser or application of the client mayexecute the code, the code comprising at least one of: code expressed inECMAScript language or a language similar or related to the ECMAScriptlanguage, code expressed in ActionScript language, code expressed inhypertext markup language, code expressed in visual basic language, aplug-in, code referencing a browser plug-in, and code referencing anative module. The executable code may include or be represented by ascript, applet, program, instructions or software for installationand/or execution on hardware (e.g., a processor) of the client. The codemay include any embodiment and/or feature of the executable codedescribed above in connection with at least FIG. 2Q. The code maysometimes be referred to as an interaction sequencer.

In some embodiments, the intermediary may modify a default renderingcharacteristic or behavior derived from the server, for each of theplurality of fragments. A default rendering characteristic may specifythat elements in a web page or fragment are to be rendered in theorder/sequence presented in the web page or fragment. The order/sequencepresented in the web page or fragment may be based on sequentialprocessing of lines of HTML written for the web page or fragment. Forexample, for HTML, rendering may start from the top of the page andproceed to the bottom of the page, until the entire page is rendered. Insome embodiments, specific elements or groups of elements may have adefault rendering characteristic or attribute, as configured by theserver. For example, certain images may be configured for lazy loading,and asynchronous loading of particular javascripts may be enabled by theserver. In certain embodiments, an element, or a group of elements, mayadopt or inherit a default rendering characteristic from a parentelement or the web page generated by the server.

Instead of following a normal standard rendering sequence or a defaultrendering characteristic, interaction sequencing based on the presentsystems and methods may manage or control the rendering sequence,priority and/or characteristic of various components. Interactionsequencing based on the present systems and methods may also limitdelivery and/or rendering to those elements that are needed. Forexample, important, required and/or available components may beprocessed/rendered immediately while the others may be deferred orprocessed as needed. In some embodiments, rendering of certaincomponents are sequenced and/or deferred for efficient use of networkbandwidth and efficient processing (e.g., by the client). For example,sequencing and/or deferral of certain components or fragments may bebased on any of the factors described above in connection with FIG. 2Q.

In some embodiments, the intermediary may modify the default renderingcharacteristic of some or all fragments of the plurality of fragments.For instance, the intermediary may modify the HTML associated with afragment. The intermediary may modify or hide an attribute pertaining toa rendering characteristic of a fragment, from the browser or renderingapplication. In certain embodiments, the intermediary may modify thedefault rendering characteristic, or replace the default renderingcharacteristic with a modified rendering characteristic. The client mayreceive the plurality of fragments from the intermediary. Each of theplurality of fragments may have a rendering characteristic modified bythe intermediary based on a configuration. The configuration may includea default configuration, a user-defined configuration and/or asystem-generated configuration that may be dynamically-updated. Theconfiguration may be defined and/or maintained for a website or webpage. The configuration may be accessed via the intermediary, accessedremotely by the code, or be delivered/injected with the code to theclient. The configuration may include any of the embodiments and/orfeatures of configurations and/or settings described above in connectionwith at least FIGS. 2I and 2Q. Each of the modified renderingcharacteristic may include a pre-trigger action, a trigger and/or anaction for rendering of a corresponding fragment of the plurality offragments. For example, in some embodiments, there may not be apre-trigger action associated with a fragment, while in certainembodiments, a modified rendering characteristic may only include adefault or pre-trigger action, e.g., that operates independently of anytrigger.

In some embodiments, the executing code may perform a pre-trigger actionfor the second fragment prior to detecting a trigger for the secondfragment. By way of illustration, and in some embodiments, a pre-triggeraction may include one or more of the following: withholding renderingof the fragment, displaying nothing at an identified location of the webpage, and displaying at least one item. The at least one item mayinclude at least one of: an indicator or message indicating that an itemis loading, a temporary or placeholder item or image, an advertisement,and a special call-to-action item. For example, withholding rendering ofthe fragment may or may not include withholding request and/or downloadof the fragment to the client. Withholding rendering of the fragment mayinclude taking no action to initiate rendering of the fragment, e.g.,not requesting and/or acquiring a resource for the fragment. Displayingnothing at an identified location may include leaving a blank or emptyarea or section at the location, not adding any items or images to abackground component at that location, or not modifying the backgroundcomponent. Displaying nothing at an identified location may include notoccupying web page space at that location (e.g., with any placeholder orempty space/section). Displaying at least one item may includedisplaying or rendering a temporary item at a specific location in theweb page. Displaying at least one item may include displaying orrendering an item which may incorporate animation (e.g., a series ofimages). Displaying at least one item may include displaying orrendering an item which may eventually be layered over by, or replacedby, content from a corresponding fragment. Displaying at least one itemmay include displaying or rendering an item to the user, such as anadvertisement, an invitation (e.g., a call-to-action widget), and avisual indicator (e.g., that the fragment or a resource is loading orcurrently unavailable).

The code may implement or initiate a corresponding pre-trigger actionfor the fragment prior to detecting the trigger. The code may implementor initiate a corresponding pre-trigger action responsive to, or as partof the loading of the web page in the browser or application. The codemay implement or initiate a corresponding pre-trigger action to improveuser experience for the page load (e.g., providing a loading status orplaceholder information). The code may implement or initiate acorresponding pre-trigger action for the fragment any time beforedetecting the trigger. If a pre-trigger action for a fragment has notbeen initiated or implemented by the time a corresponding trigger isdetected, the code may skip or withhold initiation of the pre-triggeraction. In some embodiments, a pre-trigger action is configured to beinitiated independent of any detected trigger for the same fragment. Apre-trigger action may be configured to be initiated as soon as the webpage is loaded onto the browser for display to the user. The pre-triggeraction may include or provide a reference to one or more of: code orinstructions to perform the pre-trigger action, and item(s) to displayand/or to pre-fetch as part of the action.

In further details of (403), and in some embodiments, the executing codemay dynamically detect a trigger for rendering of a fragment of afragment of the plurality of fragments (e.g., a second fragment from theplurality of fragments). The code may be configured to detect apredetermined set of events and/or set of event types during runtime(e.g., for the duration in which the web page is presented to the user).The code may be configured to detect triggers based on system calls,interrupts and/or other types of messages generated in the client orreceived by the client. A trigger may include one or a combination(e.g., temporal combination) of: a user event, a timer event and/or adocument object model event, which involves a display or use of thefragment (e.g., second fragment). The code may be configured to detectmultiple triggers that may occur simultaneously or in close successionto one another. The code may be configured to detect each trigger and toassociate or link the trigger to a corresponding post-trigger action ofa fragment. The code may include event listeners, e.g., DOM eventlisteners. In some embodiments, a trigger may be associated or linked toa plurality of post-trigger actions and/or fragments. In someembodiments, the code detects a user or user-initiated event comprisingone of: a click event, a tap event, a touch event, a mouse-over eventand a scroll event on the web page, as examples.

The code may detect that a viewing/viewable region or viewport(hereafter sometimes generally referred to as “viewing region”) of theclient and/or browser corresponds to a portion of the web page involvinga display or use of the fragment of the web page. The viewing region ata particular instance of time may include a region or portion of a webpage that the client and/or browser can display or present to the userat that instance. The viewing region may be limited by the size of theclient/browser display, zoom and/or font size settings, etc., inrelation to the web page. For example, when a web page is rendered forpresentation to a user, the browser or client may initially display afraction of the length and/or area of the web page within borders of thebrowser and/or a display screen of the client. Upon scrolling,adjustment of the browser's display area, and/or moving the browserbeyond a border of the display screen, the viewing region may change. Inresponse to a scrolling and/or zoom action, the portion of the web pageviewable in the viewing region may change. Accordingly, a trigger mayresult from the change.

The code may define or determine a size and/or shape of a viewing region(e.g., relative to a web page) based on a device profile of the client,and/or information about the browser (e.g., display dimensions andlocation relative to the screen). In some embodiments, the code detectsthat a viewing region of the client corresponds to, or includes aportion of the web page that includes a reference or unique identifieror marker corresponding to the fragment. Based on the detection, thecode may for example send a message to the server (or intermediary)requesting for the fragment. The code may be configured to track theviewing/viewable region or viewport, for example, determine or detectmomentum associated with a scrolling or zoom action. The code mayperform predictive analysis for the viewing/viewable region or viewport,for example to anticipate or identify a time at which a display or useof a certain fragment should be triggered or initiated. Based on thetracking and/or predictive analysis, the code may perform in-time orjust-in-time triggering of a corresponding post-trigger action.

In some embodiments, the code may detect a timer event. For example, adelay or time period may be configured from another event (e.g., a useror DOM event), to initiate a post-trigger action. In some cases, thedelay or time period may be configured from the time the web page beginsto load on the browser or client, or from the time of the request forthe web page. The delay or time period may be configured from a timeinstance an action (e.g., pre-trigger action) is initiated or completed.The code may be configured to include timer functionality or a timermodule to track, determine and/or manage timer events.

In some embodiments, the code may detect a DOM event, sometimes referredto as a HTML or W3C event. DOM events may be defined or identified by anevent model used by a web browser. An illustrative event model is thatstandardized by the W3C in DOM Level 2. Some common W3C events mayinclude mouse events, keyboard events, HTML frame/object events, HTMLform events, user interface events, and mutation events (e.g.,notification of a change to structure of a page or document). A DOMevent may include touch events for touch-enable devices (e.g.,touchstart, touchmove, touchleave, etc.). A DOM event may includepointer events for various types of input devices such as a mouse, touchpanel and touch pen. Pointer events may include event types such aspointerdown, pointerup, etc. A DOM event may include clipboard events,data binding events, XUL events, and DOM content loading events.

In further details of (405), and in some embodiments, the executing codemay initiate, responsive to the detected trigger, a corresponding actionfor rendering of the second fragment within the first fragment. Theexecuting code may initiate a corresponding post-trigger action forrendering of the fragment in the web page partially delivered to theclient. The action may be performed at least in part by the executingcode and/or the browser (or rendering application). For example, theaction may be performed in part by the code, and in part by the browser.The action may include rendering a fragment comprising one or more of atleast a portion of: an image, a cascading style sheet (CSS), a script, avideo object, an audio object, a flash file or small web format (SWF)file, and a HTML file.

The executing code may initiate one or more “post-trigger” actions. Theexecuting code may initiate an action based on, or responsive to thedetected trigger. An action may be configured to be initiated as soon asa corresponding trigger is detected. The action may include or provide areference to one or more of: code or instructions to perform the action,and item(s) to load, display, render and/or pre-fetch as part of theaction. In some embodiments, an action may include undoing as aspect ofa corresponding pre-trigger action. For example, the action may remove atemporary ad or indicator displayed by the pre-trigger action. The codemay initiate the action, the action comprising replacing one or moreitems displayed prior to the action, with the rendering of the fragment(e.g., second fragment).

In some embodiments, the code may initiate the action, the actioncomprising rendering the corresponding fragment immediately or as soonas the fragment is available for rendering. For example, the browserand/or code may perform one or more of the following: generating and/orsending a request for the fragment, downloading resources for renderingof the fragment, receiving the fragment (e.g., from the intermediary orfrom memory), loading the fragment in memory for processing, andincorporating the fragment into the web page. The code may initiate theaction, the action comprising rendering the fragment based on aspecified delay or after a subset of the plurality of fragments havebeen loaded. In some embodiments, the post-trigger action may includesending a request to the server for downloading a resource, the fragmentor a related fragment. For example, a resource, such as a third-partytag or item, may be accessed for rendering with the fragment or as partof the fragment. The action may include pre-fetching a resource or arelated fragment, e.g., to improve user experience.

In some embodiments, the code may initiate the action, the actioncomprising sending a request to the server, e.g., for downloading aresource, the second fragment or a related fragment. The code mayinitiate a corresponding action for rendering a specific fragment (e.g.,the second fragment), the fragment comprising one of at least a portionof: an image, a cascading style sheet (CSS), a script, a video object,an audio object, a flash file or small web format (SWF) file, and a HTMLfile. The request may be intercepted or received by the intermediary.For example, the code may generate a message based on a uniqueidentifier or marker, and/or send the message to the server as describedabove in connection with at least FIG. 2Q. The intermediary may generateand/or send a fragment corresponding to the unique identifier or marker,for incorporation into the web page or first fragment, as describedabove in connection with at least FIG. 2Q.

In some embodiments, the request to the server (for the fragment) may beintercepted or received by the intermediary. The intermediary mayprevent this request (for a particular fragment) from reaching theserver, e.g., since the server may not be able to identify the requestedfragment, and may not be even aware that the web page has been split orfragmented by the intermediary.

In certain embodiments, the code may not detect one or more triggers forrendering a subset of the plurality of fragments (e.g., during the timethe web page is presented at the client). For example, the user may notscroll from an initial viewing region that displays a portion of the webpage. The absence of scrolling may avoid triggering a correspondingpost-trigger action to render a fragment that resides beyond thatinitial viewing region. Also, by way of illustration, scrolling toanother portion of the web page may trigger a post-trigger action for afragment associated with that portion of the web page. However,post-trigger actions for some other fragments (e.g., outside of thisportion) may not be triggered. Thus, certain fragments (e.g., that maynot need to be displayed and/or used) may not have to be requested,delivered to the client, and/or rendered at the client. The use ofinteraction sequencing can therefore provide for an efficient managementof network bandwidth, and may avoid unnecessary processing at the clientand/or intermediary on fragments that are not needed, viewed and/or usedat the client.

It should be understood that the systems described above may providemultiple ones of any or each of those components and these componentsmay be provided on either a standalone machine or, in some embodiments,on multiple machines in a distributed system. In addition, the systemsand methods described above may be provided as one or morecomputer-readable programs or executable instructions embodied on or inone or more articles of manufacture. The article of manufacture may be afloppy disk, a hard disk, a CD-ROM, a flash memory card, a PROM, a RAM,a ROM, or a magnetic tape. In general, the computer-readable programsmay be implemented in any programming language, such as LISP, PERL, C,C++, C#, PROLOG, or in any byte code language such as JAVA. The softwareprograms or executable instructions may be stored on or in one or morearticles of manufacture as object code.

While the foregoing written description of the invention enables one ofordinary skill to make and use what is considered presently to be thebest mode thereof, those of ordinary skill will understand andappreciate the existence of variations, combinations, and equivalents ofthe specific embodiment, method, and examples herein. The inventionshould therefore not be limited by the above described embodiment,method, and examples, but by all embodiments and methods within thescope and spirit of the invention.

We claim:
 1. A method for delivering an item of web content requested bya client, comprising: (a) intercepting, by an intermediary between aclient and a server, a request from the client to the server for an itemof web content; (b) splitting, by the intermediary, the item of webcontent into a plurality of fragments; (c) identifying, by theintermediary responsive to the request, a first fragment of theplurality of fragments to deliver to the client for rendering on abrowser; and (d) injecting, by the intermediary, executable code intothe first fragment of the plurality of fragments, the executable code,when executing on the client, conditionally requests for a secondfragment from the plurality of fragments to be delivered from theintermediary to the client based on detection, by the executable code,of a user action on the first fragment rendered on the client that is tomove a predetermined location for a portion of the second fragment intoa viewport of the client, and receives the conditionally requestedsecond fragment to combine with the first fragment for updated renderingat the client while leaving at least a third fragment from the pluralityof fragments that is available at the intermediary undelivered.
 2. Themethod of claim 1, wherein (a) further comprises determining that theitem of web content comprises one of: an HTML page, an image, acascading style sheet (CSS), a script file, a video object, an audioobject, and a Flash file or small web format (SWF) file.
 3. The methodof claim 1, wherein (b) comprises splitting the item of web content intothe plurality of fragments based on a version of the item of web contentcached by the intermediary.
 4. The method of claim 1, wherein (b)comprises splitting the item of web content into a plurality offragments based on a response from the server to the request.
 5. Themethod of claim 1, comprising performing at least one of the splittingand the identifying, based on a user-defined configuration of the itemof web content.
 6. The method of claim 1, wherein (a) comprisesintercepting the request for the item of web content, the item of webcontent comprising dynamic or personalized information to be generatedby the server.
 7. The method of claim 1, further comprising sending, bythe intermediary, the request to the server.
 8. The method of claim 1,further comprising delivering the first fragment from a cache by theintermediary.
 9. The method of claim 1, wherein (d) comprisesrequesting, by the executable code when executing on the client, thesecond fragment from the plurality of fragments to be delivered to theclient, responsive to the detection of the user action, while leaving atleast the third fragment from the plurality of fragments undelivered.10. The method of claim 1, further comprising forming a second fragmentof the plurality of fragments based on a response from the server to therequest.
 11. The method of claim 1, wherein (d) comprises determining toconditionally request for the one or more undelivered fragments based onat least one of: a network condition, dependencies between relatedfragments, size of a fragment, importance of a fragment, availability ofa fragment, and visibility of a fragment.
 12. The method of claim 1,wherein (d) comprises determining to conditionally request for the oneor more undelivered fragments responsive to at least one of: a userevent, a timer event and a document object model event, that involves adisplay or use of the one or more fragments at the client.
 13. Themethod of claim 1, wherein (d) comprises injecting the executable code,the executable code comprising code expressed in at least one of:ECMAScript language or a language similar or related to the ECMAScriptlanguage, ActionScript language, visual basic language and hypertextmarkup language.
 14. A system for delivering an item of web contentrequested by a client, the system comprising: an intermediary devicebetween a client and a server, the intermediary device: intercepting arequest from the client to the server for an item of web content,splitting the item of web content into a plurality of fragments, andidentifying a first fragment of the plurality of fragments to deliver tothe client for rendering on a browser, responsive to the request; andexecutable code, injected by the intermediary device into the firstfragment of the plurality of fragments for execution at the client, thecode, when executing on the client, conditionally requests for a secondfragment from the plurality of fragments to be delivered from theintermediary to the client based on detection, by the executable code,of a user action on the first fragment rendered on the client that is tomove a predetermined location for a portion of the second fragment intoa viewport of the client, and receives the conditionally requestedsecond fragment to combine with the first fragment for updated renderingat the client while leaving at least a third fragment from the pluralityof fragments that is available at the intermediary undelivered.
 15. Thesystem of claim 14, wherein the intermediary device determines that theitem of web content comprises one of: an HTML page, an image, acascading style sheet (CSS), a script, a video object, an audio object,and a Flash file or small web format (SWF) file.
 16. The system of claim14, wherein the intermediary device splits the item of web content intothe plurality of fragments based on a version of the item of web contentcached by the intermediary device.
 17. The system of claim 14, whereinthe intermediary device splits the item of web content into a pluralityof fragments based on a response from the server to the request.
 18. Thesystem of claim 14, wherein the intermediary device performs at leastone of the splitting and the identifying based on a user-definedconfiguration of the item of web content.
 19. The system of claim 14,wherein the intermediary device intercepts the request for the item ofweb content, the item of web content comprising dynamic or personalizedinformation to be generated by the server.
 20. The system of claim 14,wherein the intermediary device sends the request to the server.
 21. Thesystem of claim 14, wherein the intermediary device delivers the firstfragment from a cache by the intermediary device.
 22. The system ofclaim 14, wherein the executable code requests for the second fragmentfrom the plurality of fragments to be delivered to the client,responsive to the detection of the user action, while leaving at leastthe third fragment from the plurality of fragments undelivered.
 23. Thesystem of claim 14, wherein the intermediary device forms a secondfragment of the plurality of fragments based on a response from theserver to the request.
 24. The system of claim 14, wherein theintermediary device determines to conditionally request for the one ormore undelivered fragments based on at least one of: a networkcondition, dependencies between related fragments, size of a fragment,importance of a fragment, availability of a fragment, and visibility ofa fragment.
 25. The system of claim 14, wherein the intermediary devicedetermines to conditionally request for the one or more undeliveredfragments responsive to at least one of: a user event, a timer event anda document object model event, that involves a display or use of thecorresponding fragment at the client.
 26. The system of claim 14,wherein the intermediary device injects the executable code, theexecutable code comprising code expressed in at least one of: ECMAScriptlanguage or a language similar or related to the ECMAScript language,ActionScript language, visual basic language and hypertext markuplanguage.